How to identify if device token is for android or iOS?

前端 未结 5 1874
孤街浪徒
孤街浪徒 2021-01-12 11:57

I store Android and iOS device tokens in DB. Following are few examples of device tokens getting saved in the DB.

  • 359092050465370
  • 654C4DB3-3F68-4969-8
5条回答
  •  广开言路
    2021-01-12 12:05

    Your first hash you posted, is the IMEI of the device so it's present on both Android and iOs. An IMEI only contains numbers!

    On Android, if you use the following code will give you an unique ID: Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID); that will look like that: 9774d56d682e549c which is 16 chars long.

    On iOS devices, you can get your UDID on iTunes or on websites like this one: http://whatsmyudid.com/ This UDID is 32 digits and looks like that: 294913EC-6100-42E8-8C2D-E9F68F286ADE.

    Basing on the IMEI you posted in your message, we can get your phone information such as Brand, Model and many other things. Take a look at that address: http://www.imei.info/?imei=359092050465370

提交回复
热议问题