How to refresh FCM Token on user Logout?(如何在用户注销时刷新 FCM 令牌?)
问题描述
我第一次获得 FCM 并将其保存到我的 userDefaults.现在当用户注销时,如何再次刷新 FCM 令牌?我搜索了文档和许多其他问题,但没有找到更好的解决方案.
I am getting the FCM first time and save it to my userDefaults. Now When user logs out, how can I refresh the FCM token again? I have searched the docs and many other asked questions, but didn't find a better solution.
提前致谢.
推荐答案
FCM Token 是 Instance ID 令牌,它代表已安装的应用程序,而不是已登录的用户.通常,一旦应用保持安装状态,无论哪个用户登录,它都会拥有相同的令牌.
The FCM Token is an Instance ID token, it represents the installed app and not the signed in user. Generally once the app remains installed it will have the same token no matter what user is signed in.
您必须自己管理与令牌关联的用户.当用户登录时,您应该将令牌与用户的 ID 相关联,当用户退出时,您应该删除该关联.
You would have to manage what user is associated to the token yourself. When the user signs in you should associate the token with the user's ID and when the user signs out you should remove that association.
这篇关于如何在用户注销时刷新 FCM 令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在用户注销时刷新 FCM 令牌?
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
