Iphone 是否有一种程序化的方式来获取移动设备';谁的唯一标识符?

Iphone 是否有一种程序化的方式来获取移动设备';谁的唯一标识符?,iphone,android,windows-phone-7,uniqueidentifier,unique-key,Iphone,Android,Windows Phone 7,Uniqueidentifier,Unique Key,我需要一种方法来了解每个用户的唯一性,无论是iPhone、Android还是Windows Phone设备。如果没有通用的方法,我想知道保存电话号码是否合法(即合法) 有人有这方面的经验吗?尝试获取IMEI号码。也许对你有用 谢谢如果你只为移动设备而烦恼,那么有一种叫做IMEI numner的东西。它应该是可访问的。法律含义我不确定。我想,只要你不太个人化(给人贴标签),这应该不会是个问题。我不能为iPhone或Windows Phone 7说话,但要获得Android手机的唯一ID,我建议看以

我需要一种方法来了解每个用户的唯一性,无论是iPhone、Android还是Windows Phone设备。如果没有通用的方法,我想知道保存电话号码是否合法(即合法)


有人有这方面的经验吗?

尝试获取IMEI号码。也许对你有用


谢谢

如果你只为移动设备而烦恼,那么有一种叫做IMEI numner的东西。它应该是可访问的。法律含义我不确定。我想,只要你不太个人化(给人贴标签),这应该不会是个问题。

我不能为iPhone或Windows Phone 7说话,但要获得Android手机的唯一ID,我建议看以下帖子:


如前所述,它不是100%可靠的。

在Android中,您可以通过这种方式获得它

TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
deviceid = telephonyManager.getDeviceId();

我不相信有,甚至不可能有一个跨平台的方法来做到这一点。每个设备都有自己的SDK平台和API

更新:对我之前的陈述稍加更正,因为它看起来可能会给你一个跨平台的方法

PhoneGap:

var deviceID = device.uuid;
android.telephony.getDeviceId()
[[UIDevice currentDevice] uniqueIdentifier]
DeviceExtendedProperties.GetValue("DeviceUniqueId")
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();
见:

以下是您如何在每个平台上执行此操作:

Android:

var deviceID = device.uuid;
android.telephony.getDeviceId()
[[UIDevice currentDevice] uniqueIdentifier]
DeviceExtendedProperties.GetValue("DeviceUniqueId")
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();
见:

iPhone:

var deviceID = device.uuid;
android.telephony.getDeviceId()
[[UIDevice currentDevice] uniqueIdentifier]
DeviceExtendedProperties.GetValue("DeviceUniqueId")
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();
见:

Windows Phone 7:

var deviceID = device.uuid;
android.telephony.getDeviceId()
[[UIDevice currentDevice] uniqueIdentifier]
DeviceExtendedProperties.GetValue("DeviceUniqueId")
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();
见:

黑莓:

var deviceID = device.uuid;
android.telephony.getDeviceId()
[[UIDevice currentDevice] uniqueIdentifier]
DeviceExtendedProperties.GetValue("DeviceUniqueId")
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();
请参阅:

有关iPhone 您将在iPhone中使用以下代码找到移动设备id

 NSString *uniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
 NSLog("UniqueIdentifier:-->%@",uniqueIdentifier);

这就是我为WindowsPhone所做的

 void checkGuid()
    {
            object uniqueID;
            DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out uniqueID);
            byte[] bID = (byte[])uniqueID;
            _clientID = Convert.ToBase64String(bID);
            Debug.WriteLine(_clientID);
            if (!IsolatedStorageSettings.ApplicationSettings.Contains("Guid"))
            {
                IsolatedStorageSettings.ApplicationSettings.Add("Guid", _clientID);
            }

    }
至于保留他们的电话号码,据我所知,微软会自动向用户提交一份协议,以响应他们检测到的应用程序需要使用的内容

当用户启动请求其使用其电话号码的许可的应用程序时,您可以向用户提供某种EULA