是否有一种编程方式来获取移动设备的唯一标识符?
我需要一种方法来了解每个用户的独特性,无论是 iPhone、Android 还是 Windows Phone 设备。如果没有通用的方法,我想知道保存电话号码是否合法(即合法)。
有人有这方面的经验吗?
I need a way to know the uniqueness per user, whether it be for iPhone, Android, or Windows Phone devices. If there is no universal way, i was wondering if saving the phone number would be legitimate (i.e. legal).
Anybody have any experience in this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我不相信存在,甚至可能存在跨平台的方法来做到这一点。每个设备都有自己的 SDK 平台和 API。
更新:对我之前的声明稍作修正,因为它看起来 PhoneGap 可能能够为您提供跨平台方法。
PhoneGap:
请参阅:http://docs.phonegap.com/phonegap_device_device。 md.html
以下是在每个平台上执行此操作的方法:
Android:
请参阅:http://developer.android.com/reference/android/telephony /TelephonyManager.html#getDeviceId%28%29
iPhone:
请参阅:http://developer.apple.com/library/ ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html
Windows Phone 7:
请参阅:http://msdn.microsoft.com/en-us /library/ff941122%28v=VS.92%29.aspx
黑莓:
请参阅:http://docs.blackberry.com/en/developers/deliverables/7283/Find_BlackBerry_devices_628863_11 .jsp
I don't believe there is, or even could be, a cross platform way to do this. Each device has it's own SDK platform and API's.
UPDATE: Slight correction on my previous statement as it looks like PhoneGap may be able to give you a cross platform approach.
PhoneGap:
See: http://docs.phonegap.com/phonegap_device_device.md.html
Here's how you could do it on each platform:
Android:
See: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId%28%29
iPhone:
See: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html
Windows Phone 7:
See: http://msdn.microsoft.com/en-us/library/ff941122%28v=VS.92%29.aspx
Blackberry:
See: http://docs.blackberry.com/en/developers/deliverables/7283/Find_BlackBerry_devices_628863_11.jsp
如果您只关心移动设备,那么有一个叫做 IMEI 号码的东西。应该是可以访问的。法律含义我不确定。我想只要你不变得太个人化(标记一个人),这应该不是问题。
if you are bothered about only mobile devices, then there is something called IMEI numner. which should be accessible. legal implication im not sure. i guess as long as you don't get too personal (tagging to a person), it shouldn't be a problem.
尝试获取 IMEI 号码。也许它会对你有用。
谢谢
try to get IMEI number. may be it will useful for you.
Thanks
在Android中你可以这样得到它
in Android you can get it this way
我无法代表 iPhone 或 Windows Phone 7,但要获取 Android 手机的唯一 ID,我建议查看这篇文章:
是否有唯一的 Android 设备 ID?
如前所述,它不是 100% 可靠。
I can't speak for iPhone or Windows Phone 7, but to get the Unique ID of an Android phone, I'd suggest looking at this post:
Is there a unique Android device ID?
As noted, it's not 100% reliable.
适用于iPhone
您将在 iPhone 中使用以下代码找到移动设备 ID。
For iPhone
You will find mobile device id using following code in iPhone.
这就是我为 WindowsPhone 保留电话号码的方式
,据我所知,Microsoft 自动向用户提供协议,以响应他们检测到应用程序需要使用的内容,
您可以向用户提供 EULA当他们启动应用程序时,要求他们获得使用电话号码的许可
this is how I do it for WindowsPhone
as for keeping their phone number, as far as I am aware of Microsoft automatically present the user with an agreement in response to what they detected the app needs to use,
You can present the Users with an EULA of some sort when they launch the app that asks them for permission to use their phone number