gpt4 book ai didi

android - GCM Registration Token 是否等于 GCM Registration ID?

转载 作者:太空狗 更新时间:2023-10-29 16:31:05 26 4
gpt4 key购买 nike

我今天被 gcm 弄糊涂了。我不知道我的 registrationid 是否正确。我在以 APA 开头的 registrationid 前面有字符和冒号。模式是 xXXXxxX:APA...。我使用此处的示例为 Android 客户端实现了谷歌云消息传递:https://developers.google.com/cloud-messaging/android/client .如果我使用较旧的实现(例如使用 GCMRegistrar),我只会获得以 APA 开头的注册 ID。到目前为止,我虽然注册 ID 必须以 APA 开头。

冒号之前的东西是一些 token 特定的东西吗?我是否必须将完整的 token 传递给 Web 服务,或者如果我在冒号之前剪切字符并发送以 APA 开头的注册是否可以?

最佳答案

GCM 注册 token 等于 registration_id。正如我在回答中提到的 here :

一个 FCM token ,或者通常称为 registrationToken,如 .如 GCM 文档中所述:

An ID issued by the GCM connection servers to the client app that allows it to receive messages. Note that registration tokens must be kept secret.

不同的术语指向同一件事。注册 token 的格式也可能有所不同,如 answer 所示。 :

The GCM registration token is usually around 140 chars in length, and can contain colons, underscores and hyphens. Maximum size is supposed to be 4k.

虽然我不能完全确定字符长度,但我想我已经在某处的帖子上读到它可能会超过这个数字。到处搜索。

关于android - GCM Registration Token 是否等于 GCM Registration ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38667633/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com