FCM Token 会像 GCM 注册 ID 一样定期变化吗? [英] Will FCM Token change periodically like GCM registration ID?

查看:20
本文介绍了FCM Token 会像 GCM 注册 ID 一样定期变化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Playstore 中发布了使用 GCM 的应用,并且我计划使用 FCM 进行迁移.我需要的所有信息都已找到,但我有一个问题尚未找到答案.我的问题是创建令牌后,令牌会像 GCM 那样定期更改吗?

I have published apps in playstore that use GCM and I have a plan to migrate using FCM. everything information i needed have found, but i have one question that not find answer yet. my question is when token have been created, are token will be change periodically like GCM does?

谢谢

推荐答案

与 GCM 的工作原理类似,FCM 令牌可以因令牌轮换而改变.

Similarly to how GCM works, the FCM token can change due to token-rotation.

您可以拦截实现回调的令牌轮换:FirebaseInstanceId.onTokenRefresh()

You can intercept the token rotation implementing the callback: FirebaseInstanceId.onTokenRefresh()

https://firebase.google.com/docs/cloud-messaging/android/client#sample-register

注意:令牌轮换是一种罕见的事件.不要期望经常看到它.
但是,如果您关心令牌,您应该实现 onTokenRefresh() 以了解更改.

Note: the token rotation is a rare-event. Don't expect to see it often.
But still, if you care about the token you should implement onTokenRefresh() to be informed of changes.

这篇关于FCM Token 会像 GCM 注册 ID 一样定期变化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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