FCM令牌是否会像GCM注册ID一样定期更改?

编程入门 行业动态 更新时间:2024-10-22 20:34:28
本文介绍了FCM令牌是否会像GCM注册ID一样定期更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

谢谢

解决方案

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

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

firebase.google/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()

firebase.google/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一样定期更改?

本文发布于:2023-10-30 04:31:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541773.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:令牌   会像   FCM   GCM   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!