我正在开发Angularjs + phonegap应用程序,我需要的是为所有应用程序用户获取唯一标识符。
我想从设备上获取电话号码,但看起来不可能,不是吗?
如果无法获取电话号码,您还有其他想法吗?
浏览器或设备是否有一些我可以通过javascript / angularjs获得的唯一标识符?
答案 0 :(得分:2)
您可以使用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.
...但应该足以识别应用程序实例的唯一性。