Will FCM Token change periodically like GCM registration ID?(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 一样定期变化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:FCM Token 会像 GCM 注册 ID 一样定期变化吗?
基础教程推荐
- iOS4 创建后台定时器 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
