Do Android GCM registration ids always start with

2019-03-04 16:14发布

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条回答
干净又极端
2楼-- · 2019-03-04 16:22

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.

查看更多
登录 后发表回答