问题
I would like to getting the device imei number and send it to the phonegap html page. How should we do?
In phonegap android we will get the imei number from java file and send it into javascript file.
The same way, how we will do in the iOS?
回答1:
As rckoenes mentioned, you cannot get the IMEI. Also you cannot get any ID that can link to the physical device (UDID, MAC address). However, if you need to get a unique identifier that will remain constant whenever the user uses your app, you can use the [UIDevice identifierForVendor]
property.
Note you cannot use this identifier for advertising purposes, use the [ASIdentifierManager advertisingIdentifier]
property instead (following the guidelines for AdSupport).
回答2:
You can't, Apple does not allow you to identify devices any more. UDID
and mac address solutions have all been disallowed since iOS 7.
Any solution you can find on getting the IMEI number on iOS require the use of a private library and you app will be rejected from using this.
来源:https://stackoverflow.com/questions/20902222/how-to-get-device-imei-number-programmatically-using-xcode-to-phonegap