开发者

How to get Android/iPhone device unique ID using titanium appcelerator?

开发者 https://www.devze.com 2023-03-13 11:18 出处:网络
We are using the titanium appcelerator for developing the iPhone and android ap开发者_开发技巧p. We would like to get the unique device id for user registration. Does titanium has any api to do the sa

We are using the titanium appcelerator for developing the iPhone and android ap开发者_开发技巧p. We would like to get the unique device id for user registration. Does titanium has any api to do the same. If not, how will I get the info? Answers with code samples are much appreciated.


Use this code:

Titanium.Platform.getId();


I donot know about Titanium appcelerator. But Try with the following code to get device id

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

And you should add the following permission into your Manifest.xml file:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Thanks Deepak

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号