开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜