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.