I am developing a Xamarin.Forms application with Xamarin.Android and Xamarin.iOS clients. For push notifications, I am using FirebasePushNotificationPlugin library. It works perfectly on Android, but not on iOS.
On iOS the app simply closes down after the request to use push notifications. So: the "Allow/Don't allow" popup is shown, and when the user clicks on Allow, the app closes down. No exception is thrown or anything.
I have done every step in the setup instructions, but just to double-check, I will show you screenshots of everything:
BundleResource
.It is production
(and not development
) because I cannot run and debug the app, so the app is actually being uploaded every time to the App Store Connect and tested with TestFlight as an internal tester.
AppDelegate.FinishedLaunching
method, right after LoadApplication(new App());
. The false
parameter means that it will not auto register for notifications (it will be registered later manually).I also override methods RegisteredForRemoteNotifications
, FailedToRegisterForRemoteNotifications
, DidReceiveRemoteNotification
and call respected methods (as stated in the Getting Started instructions).
CrossFirebasePushNotification.Current.RegisterForPushNotifications();
, it shows the "Allow/Don't allow" popup, and after the user clicks "Allow", the app simply closes. No exception is thrown or anything (well, at least nothing gets caught in the try/catch statement). The app simply shuts down.The interesting thing maybe is, that the FCM token is already (successfuly) created before all this and if I send a push message to that token (of that iOS app), the Firebase server returns success
. So I'm guessing that the Firebase part is correct, but there is something wrong with the iOS and/or the library?
Any advice whatsoever will be greatly appreciated!
For anyone reading this: I have solved this problem by removing the FirebasePushNotificationPlugin library, which apparently doesn't work on iOS. I have then implemented the notifications using the Xamarin.Firebase.iOS.CloudMessaging package instead, following this GettingStarted guideline.
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