FCM令牌是否会像GCM注册ID一样定期更改? [英] Will FCM Token change periodically like GCM registration ID?

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

问题描述

我在Playstore上发布了使用GCM的应用程序,我有一个使用FCM进行迁移的计划。我需要的一切信息都已找到,但是我有一个问题没有找到答案。我的问题是什么时候创建了令牌,令牌会像GCM那样周期性地发生变化?



谢谢

解决方案

与GCM的工作方式类似,FCM令牌可能因令牌轮换而发生更改。



您可以截取执行回调: FirebaseInstanceId.onTokenRefresh()



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



注意:令牌轮换是一种罕见事件。不要指望经常看到它。

但是,如果你关心的是令牌,你应该实现 onTokenRefresh()来通知变化。

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?

thanks

解决方案

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

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

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

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令牌是否会像GCM注册ID一样定期更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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