什么时候android gcm令牌到期

我对
android Gcm Token Expire策略感到好奇.

当我想要使用Gcm服务注册的设备能够接收Gcm推送消息时,我将使用API​​注册它.

然后我会得到一个Gcm令牌“A”.
如果我从未在Play商店中升级我的应用版本代码.
谷歌会用“B”刷新它并自动过期“A”吗?

如果是,它何时会这样做.
我看过一些文章说一旦“A”用“B”刷新,那么当服务器尝试向“A”发送消息时,服务器将获得新的注册ID“B”.我现在想知道客户端如何知道gcm令牌“A”已过期并被“B”取代

有人可以回答我的问题吗?

谢谢

最佳答案 是的,用doc实现
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.

点赞