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
精彩评论