且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式使用xcode到phonegap获取设备IMEI号?

更新时间:2022-10-25 16:44:51

如rckoenes所述,您无法获得IMEI。此外,您不能获取任何可以链接到物理设备(UDID,MAC地址)的ID。但是,如果您需要获取一个在用户使用您的应用时保持不变的唯一标识符,则可以使用 [UIDevice identifierForVendor] 属性。



请注意,您不能将此标识符用于广告目的,请改用 [ASIdentifierManager advertisingIdentifier] 属性(遵循AdSupport指南)。


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?

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).