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. Dismiss Notice

Is SystemInfo.deviceUniqueIdentifier globally unique?

Discussion in 'iOS and tvOS' started by egoquat, Apr 8, 2014.

  1. egoquat

    egoquat

    Joined:
    Jul 4, 2012
    Posts:
    93
    hello. I want to know SystemInfo.deviceUniqueIdentifier is unique globally on IOS or not.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    On iOS7 devices it will be UIDevice identifierForVendor or, if that fails for any reason, ASIdentifierManager advertisingIdentifier. You might need to ask Apple if their APIs are globally unique. It is known that an app installed on a device returns one id, but if you re-install the app you can get a second, different id.
     
  3. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    I wouldn't build any security thing in game around deviceUniqueIdentifier since AFAIK it can be spoofed with jailbroken devices.
     
  4. egoquat

    egoquat

    Joined:
    Jul 4, 2012
    Posts:
    93
    Thanks for your replies.
     
  5. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,904
    Does this includes app update from App Store?
     
  6. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    App updates don't change identification strings.
     
  7. creasaur

    creasaur

    Joined:
    Sep 5, 2017
    Posts:
    4
    @Agent_007 , can you provide the source for that?
     
  8. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    From Unity's docs for SystemInfo.deviceUniqueIdentifier:

    "on pre-iOS7 devices it will return hash of MAC address. On iOS7 devices it will be UIDevice identifierForVendor or, if that fails for any reason, ASIdentifierManager advertisingIdentifier."

    And, from Apple's docs for identifierForVendor:

    "The value of this property is the same for apps that come from the same vendor running on the same device."

    "The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution."