我正在尝试将我的应用程序从Google云消息传递(GCM)迁移到firebase云消息传递(FCM).医生说我们需要把这个功能
func application(application: UIApplication,didRegisterForRemoteNotificationsWithDevicetoken devicetoken: NSData) { FIRInstanceID.instanceID().setAPNSToken(devicetoken,type:FIRInstanceIDAPNSTokenTypeSandBox) }
但是我在FIRInstanceIDAPNSTokenTypeSandBox上获得了未解析的标识符,即使我已经导入了Firebase,FirebaseInstanceID,FirebaseMessaging.你知道为什么吗?
我很欣赏你们的任何线索.谢谢!
解决方法
对于Swift,你必须使用
FIRInstanceIDAPNSTokenType.SandBox而不是FIRInstanceIDAPNSTokenTypeSandBox.
FIRInstanceIDAPNSTokenType.SandBox而不是FIRInstanceIDAPNSTokenTypeSandBox.
这个对我有用.