Firebase Notification To Device with FCM Token Says Sent but not received

后端 未结 4 799
星月不相逢
星月不相逢 2020-12-31 15:54

I am attempting to send a simple push notification from the firebase notification console to a specific device using an FCM token. The firebase notification console shows t

4条回答
  •  遥遥无期
    2020-12-31 16:28

    Try to add the following code to didRegisterForRemoteNotificationsWithDeviceToken func:

    Messaging.messaging().apnsToken = deviceToken
    

    So it will look like this:

    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    
        Messaging.messaging().apnsToken = deviceToken
    }
    

    It is work for me.

提交回复
热议问题