Need consistent deviceID - deviceID and permanentID are inconsistent

okay. I’m 50% there with an iOS solution - thank you for the openUDID recommendation for iOS. What API to you recommend for Android to get a consistent value? deviceID changes every time the program is uninstalled and then reinstalled, so it’s not consistent. Any suggestions?

If you add the “android.permission.READ_PHONE_STATE” to your build settings the system.getInfo(“deviceId”) call will return the IMEI/MEID id for the phone. This should be consistent after reinstalls etc.

I have just verified that this solution works on Android:

 

Step 1) “android.permission.READ_PHONE_STATE” to the build settings file

Step 2) use system.getInfo(“deviceId”) to return the IMEI/MEID id for the phone.

Step 2 will not work properly without  Step 1.

Does ANYONE have any ideas about how to get a consistent identifier from an iOS device in Corona?

For iOS, I have just verified that I cannot include the openUdid plugin. When I attempt to create an iOS build on the Mac, I get the message “Unexpected build error. Error code: 5…” - the message has some nonsense about connecting directly without a proxy server, which I am not using. But I have confirmed 5 different times that removing the plugin allows the build to complete. Corona simple will not create a build with the openUdid plugin - this should be documented in the API page as no longer working.

Have you tried system.getInfo(“iosIdentifierForVendor”) ?

I will try getInfo(“iosidentifierForVendor”). I read somewhere online that it wasn’t consistent all the time. I will try and report back.

Yeah try it.

But I think you will have a hard time finding a 100% persistent id on ios, because apple want users to be able to control their privacy.

It is possible to store things in the Keychain after you retrieve them once -> if I can do that, I will have solved this.

After much research, I have realized that with iOS 6, Apple introduced two new properties in the UIDevice family, similar in nature to the “deprecated” UDID.  That’s right, Apple will no longer allow anyone to use the UDID. Even though the open source OpenUDID solution which was implemented by Corona is no longer supported - I get a Build error #5 in Corona now.

The two new similar options to use are:

  1. system.getInfo(“identifierForVendor”) – this option is supported by Corona and is the only option for iOS determination for NON-ADVERTISING companies.

  2. in thte ASIdentifierManager class, identifierForAdvertising is the best option - but misuse of it will likely cause relationship problems with Apple. Misuse is defined as using this identifier for reasons OTHER than ad tracking like using the ID to keep track scores, levels, and other app user behaviors - which is now greatly discouraged by Apple.

In summary, #1 is the best Corona option. From the time a developer’s app is first installed, the IdentifierForVendor will not change so long as that device always has at least one app installed by a given developer. If uninstalled however, and then reinstalled, a new identifierForVendor value will appear - nothing can be done to get around this without risking big problems with Apple, period the end.

If you benefited from my research, please let me know and encourage me to continue to post my results when other Forum users don’t know the answers. Thank you :slight_smile: