I'm developing a native iOS app and I`m kind of newbie both to objective-C and apple device development.
In my app I need to identify the user by an unique way. I think that the best solution would be to obtain current Apple ID and store it in online database for my purposes. The only catch is that the user can change it. So, I`m thinking Apple has to have another identifier to uniquely distinguish the actual accounts.
Is there any way I can get that one? Something I missed? Some class?
Thanks in advance... Pete
All IOS devices have and Unique identifier UDID, wich is accesible through:
[[UIDevice currentDevice] uniqueIdentifier]
But this is discouraged by Apple and some apps are getting rejected by using this, basically because apple doesn't want you to track or treat devices as unique, because you can sell it or swap it with another person.
What you can do is to create a UUID which is a unique identifier and store it in the key chain, which means that this uniqueID will remain in the phone even if the app is deleted, it will only disappear when the you do a factory reset, which is what apple wants.
Another solution is to use external libraries that will generate uniqueID on a device basis like openUDID or UIDevice-with-UniqueIdentifier-for-iOS-5
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With