Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UniqueIdentifier in ios 7

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)

like image 807
user100 Avatar asked Mar 21 '23 15:03

user100


2 Answers

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.

enter image description 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.

like image 74
βhargavḯ Avatar answered Apr 01 '23 18:04

βhargavḯ


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.

like image 26
grahamparks Avatar answered Apr 01 '23 19:04

grahamparks