【发布时间】:2016-06-15 01:33:15
【问题描述】:
有谁知道如何强制刷新 FCM 生成的注册令牌?我最近才尝试将我的项目从 GCM 迁移到 FCM。
Firebase 网站上的文档提到使用以下方法生成令牌:
// Get the default token
// The first time you call this, the token may not be available, in which case
// the SDK returns nil.
// Once the token is fetched from the server, the SDK posts a token refresh
// notification that you can listen for in order to access the new token.
NSString *token = [[FIRInstanceID instanceID] token];
但看起来我只得到了我调用FIRInstanceID.instanceID().token()时最初生成的令牌
【问题讨论】:
标签: ios swift google-cloud-messaging firebase-cloud-messaging