Android GCM注册ID始终以“APA”开头吗? [英] Do Android GCM registration ids always start with "APA"?

查看:128
本文介绍了Android GCM注册ID始终以“APA”开头吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我注册了不同的设备,为Android设备存储了GCM注册ID,为iOS设备存储设备令牌(推送通知)。



我想区分一个设备是iOS还是Android。最简单的方法是什么? Android GCM RegIds是否始终以字符串APA启动?

解决方案

总之,如果您需要区分Android和iOS客户端在将它发送到您的服务器时,包含一个平台标识符(例如:platform:Android)以及InstanceID令牌。通过这种方式,您可以知道哪些客户端在哪个平台上。



您不应该依赖InstanceId标记的格式来确定设备平台。


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"?

解决方案

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.

这篇关于Android GCM注册ID始终以“APA”开头吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆