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

Using deviceUniqueIdentifier on iOS 14

Discussion in 'iOS and tvOS' started by chebe123, Feb 19, 2021.

  1. chebe123

    chebe123

    Joined:
    Jan 24, 2020
    Posts:
    18
    Hello,

    We use deviceUniqueIdentifier as an id for users in our game. By unity doc:


    iOS: 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.


    Right now it means that if we use that field before the App Tracing Transparency aler we might be accessing idfa without users consent, also does this mean that if users reject there might be multiple users with same unique identifiers: 00000000-0000-0000-0000-000000000000, which is the default idfa if users reject the tracking?

    Thanks.
     
  2. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Do not ID your players with deviceUniqueIdentifier. Any jailbroken device can change the outcome of that method.
     
  3. chebe123

    chebe123

    Joined:
    Jan 24, 2020
    Posts:
    18
    Yeah we are aware of that, but we are using some legacy code, and we have a relatively huge userbase, so a change to something else would be time consuming and almost impossible.

    Also please, can anyone answer the couple of questions i've asked in the post above?
     
  4. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    505
  5. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    From 2020.2 upwards
    advertisingIdentifier
    is not being used as a fallback for
    deviceUniqueIdentifier
    . That means
    deviceUniqueIdentifier
    will not be affected by App Tracing Transparency changes.
    deviceUniqueIdentifier
    is a legitimate way to differentiate between users, but it does reset when user deletes all of the apps by the vendor, so it can't be used for persistent user identification.

    But I suggest using game center for user identification as it provides more reliable identification and other great features such as different users on a same device.
     
    Neonlyte likes this.
  6. chebe123

    chebe123

    Joined:
    Jan 24, 2020
    Posts:
    18
    Hello Petras,

    Thanks for the answer, we are using 2018.4, and migrating to 2020.2 is certanly an option, but its not an lts version and it would require some work, due to certain things being depreciated, like .net scripting backend for uwp.
    Would the behaviour i described in my first question be present in 2018.4, which is an lts version of unity and the one that we use?
    We are aware of better solutions for uniquely identifing our users, but also we are maintaing an app with a huge legacy codebase and a lot of active users, so changing something like that would be a huge task, also losing progress after uninstalling is intended, so its not a concern of ours.

    Thanks a lot for the answer.
     
  7. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    I investigated further and found out that all lts versions do not fallback on
    advertisingIdentifier
    so you shouldn't run into problems with your current setup.

    That being said, 2018.4 is loosing it's lts status in couple months, I suggest looking into migrating to another supported Unity version.
     
  8. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    591
    Is it safe to use this one then? https://docs.unity3d.com/ScriptReference/iOS.Device-vendorIdentifier.html
    I think it will not change right