How to find Serial Number, IMEI number using iOS SDK

ぃ、小莉子 提交于 2019-11-28 02:02:34

Apple does not allow you the retrieve any device specific information like IMEI, UDID, Mac address, serial number, etc..

This has to do with the misuse of these identifier and the privacy of the user.

Apple forbids retrieving such information, as this is potentially harmful to the end users. Instead they provide you with identifierForVendor:

An alphanumeric string that uniquely identifies a device to the app’s vendor. (read-only)

refs: https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor

If you need to distinguish different apps from same vendor(on same device) you could use advertisingIdentifier, however docs clearly states it must be used only when it is in duty of ads(whether contributing install to an ad, or presenting ads in your app). Moreover I had application rejected because it was using this id, and was not declared in iTunesConnect.

An alphanumeric string unique to each device, used only for serving advertisements. (read-only)

refs: https://developer.apple.com/library/ios/documentation/AdSupport/Reference/ASIdentifierManager_Ref/ASIdentifierManager.html#//apple_ref/occ/instp/ASIdentifierManager/advertisingIdentifier

If you still decide to go for the latter one, don't forget do add AddSupport.framework to you project settings.

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