I have this method to access the token (FireBaseCloudMessasing) in my VC instead of storing it in the AppDelegate but I got this error : Value of type 'Messaging' has no member 'token'
func getFCM(){
Messaging.messaging().token { token, error in
if let error = error {
print("Error fetching FCM registration token: (error)")
} else if let token = token {
print("FCM registration token: (token)")
self.fcmRegTokenMessage.text = "Remote FCM registration token: (token)"
}
}
}