Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios unique identifier across installs

We need to uniquely identify the device and it has to be same across installs (reinstall). We have been using identifier stored in keychain till now so it persists across installs. Now with 10.3 beta the key chain is auto deleted when the app is uninstalled. Ref: https://forums.developer.apple.com/thread/72271

Can we use AdIdentifier as unique identifier. We have ads served and we are at the moment using it for the same.

like image 797
Snowy Avatar asked Mar 08 '17 13:03

Snowy


People also ask

Is iOS UUID unique?

Your UDID is a unique identifier that Apple uses to associate a device to an iOS developer account.

Can UUID change iOS?

The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and re-install the app, and possibly also when you upgrade iOS, or even upgrade the app per version (apparent in iOS 5.1). The uuid is not a reliable value.

What is iOS device identifier?

Apple device IDs Every Apple iPhone, iPod touch and iPad has a unique device ID number associated with it, known as a Unique Device ID (UDID). Apple's device ID is a 40-digit sequence of letters and numbers. Customers can access their device ID numbers in iTunes or by downloading a free app from the Apple App Store.


1 Answers

There seems to be a workaround. It's actually mentioned in the forum you linked.

By making the keychain item available to other apps you can ensure it won't be deleted when your app is deleted.

To do that, you can add the item to kSecAttrAccessGroupToken access group on iOS 10. See https://gist.github.com/Raztor0/34ad0e23a410c33526c9fa1b6e8d281c

If you set the access group to this well-known group, your keychain item will be readable by all installed apps:

Every application has access to this access group so it is not needed to explicitly list it in keychain-access-groups entitlement, but application must explicitly state this access group in keychain queries in order to be able to access items from external tokens.

That makes the item unsuitable for any sensitive or secret data (e.g. passwords, user names etc). For a unique identification of devices this shouldn't matter.

like image 75
Sulthan Avatar answered Oct 08 '22 13:10

Sulthan