Search code examples
objective-cios7uniqueidentifier

Uniquely identifying user across app installs/uninstalls for iOS7


For iOS 7, is there a method of obtaining a unique id that persists across app uninstalls/installs?

If I understand correctly, as of iOS 7, you no longer have programmatic access to the MAC address and calling [[[UIDevice currentDevice] identifierForVendor] UUIDString]; produces a new id after a user has uninstalled your app.

Note: Most solutions I have come across have been deprecated years ago. The solution here -> UIDevice uniqueIdentifier Deprecated - What To Do Now? is also no longer valid... My interest in this is not to authorize users but to ban certain users. If users sell their device it would require administrative intervention to lift the ban. But that will be a very small number of incidents since the ID is not used for authorization. Buying a users device will not grant you access to that users account.


Solution

  • You can create a UUID and write it to the keychain,that persists across installs.