Alv*_*par 2 iphone android uniqueidentifier unique-key windows-phone-7
我需要一种方法来了解每个用户的唯一性,无论是iPhone,Android还是Windows Phone设备.如果没有普遍的方式,我想知道保存电话号码是否合法(即合法).
有人有这方面的经验吗?
bre*_*dan 12
我不相信有甚至可能是跨平台的方式来做到这一点.每个设备都有自己的SDK平台和API.
更新:对我之前的声明稍作修正,因为看起来PhoneGap可能能够为您提供跨平台的方法.
PhoneGap的:
var deviceID = device.uuid;
Run Code Online (Sandbox Code Playgroud)
请参阅:http://docs.phonegap.com/phonegap_device_device.md.html
以下是您可以在每个平台上执行此操作的方法:
安卓:
android.telephony.getDeviceId()
Run Code Online (Sandbox Code Playgroud)
请参阅:http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId%28%29
苹果手机:
[[UIDevice currentDevice] uniqueIdentifier]
Run Code Online (Sandbox Code Playgroud)
请参阅:http: //developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html
Windows Phone 7:
DeviceExtendedProperties.GetValue("DeviceUniqueId")
Run Code Online (Sandbox Code Playgroud)
请参阅:http://msdn.microsoft.com/en-us/library/ff941122%28v=VS.92%29.aspx
黑莓:
FindDeviceForUserResult result=coreWebService.findDeviceForUser(userId, locale, true);
if (result.getFindDeviceForUserReturnStatus().getCode()!= FindDeviceForUserReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
if (result.getDevice() == null)
{
// notify the user
}
int deviceID = result.getDevice().getDeviceId();
Run Code Online (Sandbox Code Playgroud)
请参阅:http://docs.blackberry.com/en/developers/deliverables/7283/Find_BlackBerry_devices_628863_11.jsp
| 归档时间: |
|
| 查看次数: |
4561 次 |
| 最近记录: |