IMEI as a fallback of UDID, is it a good idea?

a 夏天 提交于 2019-12-12 16:04:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!