Before deprecation of uniqueIdentifier it was good to use same identifier even deleting app and even erasing iPhone. After that I use MAC address and that was also working before iOS 7, but with iOS 7 it gives 2c:00:00:00:00:00. So I am not getting any way to get unique identifier. If is use IdentifierForVender: it gives different identifier if I delete the all the app of same vendor.
MAC Address : it works fine but not on iOS 7.
UniqueIdentifier :deprecated.
Please tell me the way to get unique value even app deletion and even erasing iPhone(like factory restore)
EDIT 3
Storing UUID in keychain seems to be next generic solution for this. This may solve issue for iOS7.
EDIT 2
Note: This solution in iOS 7 is no longer useful as uniqueIdentifier is no longer available from iOS7.
All possibilities and different ID maintenance are explained here.
For more details visit this link.
EDIT 1
This is the older approach but if you deadly need ID to retain even if system reset. Then you should look at this. This may help you.
I would like you to see at this popular link
1) MD5 of MAC+CFBundleIdentifier
[[UIDevice currentDevice] uniqueDeviceIdentifier]
This will remain same per app but different for each app. If you delete and reinstall your app it will be same per app. If you reset your system it will be same per app.
2) MD5 of the MAC
[[UIDevice currentDevice] uniqueGlobalDeviceIdentifier]
This will remain same for all app from same device. If you delete and reinstall your app it will be same per device. If you reset your system it will be same per device.
Pretty much the only way to achieve this is to generate a random ID yourself (e.g. a UUID) and store it in the iOS keychain.
The keychain is not cleared when the app is uninstalled, so you should still be able to read the value back after a reinstall.
The other more straightforward persistent ID mechanisms have been blocked or banned by Apple.
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