I'm trying to add Firebase Messaging to my iOS app. I've followed the steps in the Firebase documentation, namely:
[FIRApp configure]
@import FirebaseMessaging
and added FIRMessagingDelegate
However at this point I get an error:
@interface AppDelegate () <UNUserNotificationCenterDelegate, FIRMessagingDelegate>
// Cannot find protocol declaration for FIRMessagingDelegate
I've updated my pods (suggested by similar issues found on Stack Overflow), but still get the same error. To confirm, running pod update
gives the following output:
Using FirebaseMessaging (1.2.2)
Any suggestions?
The issue seems to be that the FIRMessagingDelegate
protocol is declared in the new FirebaseMessaging
framework.
Simply add:
@import FirebaseMessaging;
See more at: https://firebase.google.com/docs/reference/ios/firebasemessaging/api/reference/Protocols/FIRMessagingDelegate
and the sample app AppDelegate.m
here:
https://github.com/firebase/quickstart-ios/blob/master/messaging/MessagingExample/AppDelegate.m#L62-L85
I found this useful in the pod file:
pod 'Firebase/Messaging'
to
pod 'Firebase/Messaging', '~> 4.0.0'
Now all dependencies are found.
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