Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Device unique identifier not working as expected

Discussion in 'iOS and tvOS' started by ignitiongames, Oct 7, 2015.

  1. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    I am using SystemInfo.deviceUniqueIdentifier to identify a user and look them up in a database to return their game data, however it seems that SystemInfo.deviceUniqueIdentifier will actually change. It seems to change when uninstalling/reinstalling the app and when OS updates are done. This is really problematic for me as it involves relinking an account each time this happens.

    Does anyone have any insight into why this variable will change and maybe even a better way of identifying a device no matter what is changed about it?
     
  2. ignitiongames

    ignitiongames

    Joined:
    Feb 27, 2015
    Posts:
    20
    Anyone have any input at all on this?
     
  3. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Hi,

    This is expected if this is the last app of the vendor. If you want to preserve device identifier across reinstalls, please implement something like this
    http://stackoverflow.com/questions/...r-in-ios-after-uninstalling-ios-app-on-device in a plugin.

    We unfortunately can't make storing user identifier into keychain as underlying implementation of deviceUniqueIdentifier because of the risk of Apple starting rejecting apps that do that.

    As for iOS updates we'll try to reproduce the issue. Could you please tell which updates have caused uniqueDeviceIdentifier to change?