在做移动应用的时候,很多时候我们需要对手机进行认证,记录是否是从同一部手机发来的请求,这个时候我们就需要获取手机的IMEI码(IMEI(International Mobile Equipment Identity)是国际移动设备身份码的缩写)。
如何在Titanium中获取手机的IMEI码呢,很多人都期待官方能够提供这个API(其实获取也不太复杂)。但是看看下边的BUG的回馈,大家以后就死心吧,由于隐私方面的原因,官方对于这个问题的解决方案是“Resolution: Won't Fix”!!!
[url=https://jira.appcelerator.org/browse/TIMOB-7320]TIMOB-7320 API: Need to get IMEI of device[/url]
那么我们如果非得需要获取IMEI的话又该怎么办呢?只能自己做Module能实现!
Andorid版代码参考:
iPhone版的话,有好心人做好Module了,大家试试看吧!
[url=http://developer.appcelerator.com/question/78861/is-it-possible-to-obtain-imei-and-imsi-from-the-mobile-device]Is it possible to obtain IMEI and IMSI from the mobile device?[/url]
如何在Titanium中获取手机的IMEI码呢,很多人都期待官方能够提供这个API(其实获取也不太复杂)。但是看看下边的BUG的回馈,大家以后就死心吧,由于隐私方面的原因,官方对于这个问题的解决方案是“Resolution: Won't Fix”!!!
[url=https://jira.appcelerator.org/browse/TIMOB-7320]TIMOB-7320 API: Need to get IMEI of device[/url]
那么我们如果非得需要获取IMEI的话又该怎么办呢?只能自己做Module能实现!
Andorid版代码参考:
String imei = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId();
iPhone版的话,有好心人做好Module了,大家试试看吧!
[url=http://developer.appcelerator.com/question/78861/is-it-possible-to-obtain-imei-and-imsi-from-the-mobile-device]Is it possible to obtain IMEI and IMSI from the mobile device?[/url]