Do Android GCM registration ids always start with “APA”?

心不动则不痛 提交于 2019-12-20 05:57:20

问题


In my app I have different devices registered and for the Android ones I am storing the GCM Registration Id and for the iOS I am storing the device token (push notifications).

I want to distinguish when a device is iOS or Android. What is the easiest way to do it? Do Android GCM RegIds start always with string "APA"?


回答1:


In short no.

If you need to distinguish between Android and iOS clients, include a platform identifier (eg: platform: Android) along with the InstanceID token when sending it to your server. This way on your server you can know which clients are on which platform.

You should not depend on the format of the InstanceId tokens to determine device platform.



来源:https://stackoverflow.com/questions/33355586/do-android-gcm-registration-ids-always-start-with-apa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!