问题
Another question about UDID ...
UDID is a unique identifier for the phone, but the IMEI number is also a unique identifier. I understand that a device can have different MAC adress, but the IMEI is unique.
So my question is should I use IMEI as a fallback of the UDID. Although, if the UDID has been deprecated to avoid customer tracking, is it possible that Apple will reject application that use the IMEI number, or even disable the possibility to access the IMEI number ?
回答1:
I am sure you can't get the iPhone's
IMEI
without using a private framework and if you do so you will be automatically rejected. Even more iPods
does not have an IMEI
number. Apple
also forbids using the UDID
, so you should stick to Apple's
suggestions:
Special Considerations
Do not use the uniqueIdentifier property. To create a unique identifier specific to your app, you can call the CFUUIDCreate function to create a UUID, and write it to the defaults database using the NSUserDefaults class.
回答2:
Usually, when mobile developpers wants some unique ids, the solution is to ask the user's email address. If you really want to differentiate users devices, you can create some random UUID that you save in the app preferences.
Hope it helps ;)
来源:https://stackoverflow.com/questions/11342094/imei-as-a-fallback-of-udid-is-it-a-good-idea