How to handle this kind of warning
I have used
func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
print("message data : \(remoteMessage.appData)")
}
Do you really want to use remoteMessage: MessagingRemoteMessage
?
In my case, on the MessagingDelegate
, the only thing I need is to get the fcmToken (Firebase Registration Token), I completely remove the remoteMessage: MessagingRemoteMessage
extension AppDelegate: MessagingDelegate{
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
print("Firebase registration token: \(fcmToken)")
let dataDict:[String: String] = ["token": fcmToken]
firebaseData.fcmToken = fcmToken
NotificationCenter.default.post(name: Notification.Name("FCMToken"), object: nil, userInfo: dataDict)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With