Phonegap和Angularjs-iOS唯一标识符

Phonegap and Angularjs - iOS unique identifier

本文关键字:标识符 唯一 Angularjs-iOS Phonegap      更新时间:2023-09-26

我正在开发一个Angularjs+phonegap应用程序,我需要的是为所有应用程序用户获得一个唯一的标识符。

我想从设备上获取电话号码,但看起来不可能,不是吗?

如果无法获得电话号码,你还有其他想法吗?

浏览器或设备是否有我可以通过javascript/angularjs获得的唯一标识符?

您可以使用device.uuid,它将返回一个唯一的字符串。该字符串的生成方式因设备制造商而异:

// Android: Returns a random 64-bit integer (as a string, again!)
//          The integer is generated on the device's first boot
//
// BlackBerry: Returns the PIN number of the device
//             This is a nine-digit unique integer (as a string, though!)
//
// iPhone: (Paraphrased from the UIDevice Class documentation)
//         Returns a string of hash values created from multiple hardware identifies.
//         It is guaranteed to be unique for every device and cannot be tied
//         to the user account.
//
// Windows Phone 7 : Returns a hash of device+current user,
// if the user is not defined, a guid is generated and will persist until the app is uninstalled
//
// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
// unique to every GSM and UMTS mobile phone.

但是应该足以识别应用程序实例的唯一性。