FCM Swift - 发送个人通知在Console中不起作用

时间:2016-09-07 07:22:15

标签: ios swift firebase-cloud-messaging firebase-notifications

我使用此方法在控制台上获取令牌:

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
        let tokenChars = UnsafePointer<CChar>(deviceToken.bytes)
        var tokenString = ""

        for i in 0..<deviceToken.length {
            tokenString += String(format: "%02.2hhx", arguments: [tokenChars[i]])
        }

        //Tricky line
        FIRInstanceID.instanceID().setAPNSToken(deviceToken, type: FIRInstanceIDAPNSTokenType.Unknown)
        print("Device Token:", tokenString)
}

当我在Firebase Console上发送个人通知时,我会收到状态failed,但是当我发送群组通知时,它会起作用。有什么帮助吗?

0 个答案:

没有答案