gpt4 book ai didi

android - android gcm token 什么时候过期

转载 作者:太空宇宙 更新时间:2023-11-03 10:18:39 24 4
gpt4 key购买 nike

我很好奇 android Gcm Token Expire 策​​略。当我希望注册了 Gcm 服务的设备能够接收 Gcm 推送消息时,我将使用 API 注册它。

然后我将获得一个 Gcm token “A”。如果我从不在 Play 商店升级我的应用程序版本代码。谷歌会用“B”刷新它并自动使“A”过期吗?

如果是,什么时候做。我看过一些文章说,一旦“A”被“B”刷新,那么当服务器尝试向“A”发送消息时,服务器将获得新的注册 ID“B”。我现在想知道客户端如何知道 gcm token “A”已过期并被替换为“B”

有人能回答我的问题吗?

谢谢

最佳答案

是的,实现onTokenRefresh()与文档

Called when the system determines that the tokens need to be refreshed. The application should call getToken() and send the tokens to all application servers. This will not be called very frequently, it is needed for key rotation and to handle special cases. The system will throttle the refresh event across all devices to avoid overloading application servers with token updates.

关于android - android gcm token 什么时候过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30024729/

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