2

How Firebase PushNotification Works with iOS and APNS. I am confusing between deviceToken and fcm Token. Where Device Token is given by a Method in AppDelegate I,e


func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        print("deviceToken::::",deviceToken)
    }

and fcm Token is given by a Method of

import FirebaseMessaging

class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {

 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)
    {
        print("Firebase registration token::::::: \(fcmToken)")

    }

}

So, What is the use of both Token? and How Firebase Communicate with APNS and Our App Server I want to know hole the process and mechanism behind of Firebase Push Notification.

And also what is the use of this didRefreshRegistrationToken Method

 func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {
      print("fcmToken::::",fcmToken)
    }

Please help me to understand this deeply. From Starting to End process and Mechanism.

Kumar Lav
  • 234
  • 1
  • 3
  • 9
  • Almost the same question was asked 2 mins before this. Someone should mark this as duplicate, I don't have a privilege. – faris97 Feb 06 '20 at 14:00
  • @faris97: Thanks for flagging. A link would be most helpful in that case. – Frank van Puffelen Feb 06 '20 at 14:28
  • @FrankvanPuffelen https://stackoverflow.com/questions/60096175/firebase-push-notifications-not-working-with-ios its here – faris97 Feb 06 '20 at 14:37
  • Thanks! Seems like a quite different question to me at first glance, which just happens to be about FCM on iOS. So I won't close it as a duplicate, although others may of course cast their votes too. – Frank van Puffelen Feb 06 '20 at 15:05

0 Answers0