In this post, we will see how to resolve .Net Maui iOS app with Push Notifications WillPresentNotification or DidReceiveNotificationResponse never gets called
Question:
I’m able to call RegisterForRemoteNotifications(); from the AppDelegate to get the Token. I’m then using an APN server I built to update Apple Passes. I’m sending a message with the correct payload, headers etc…, but nothing ever happens.I’m assuming that something needs to be added to MauiProgram.cs in order to get this to work.
Seeing as I have my own APN server, I really don’t want to use Firebase or Azure Notification Hub at this time. A Firebase method is provided in the following link.
https://github.com/xamarin/xamarin-forms-samples/tree/main/LocalNotifications
Here is my code with some decorations.
Does anyone know how to make this work? Seems like this should be pretty easy to do.
Best Answer:
I finally got this working using the Firebase.plugin for .Net Maui. My APN server still doesn’t work. I’m using the Firebase console to send messages.I used these directions.
https://cedricgabrang.medium.com/firebase-push-notifications-in-net-maui-ios-2f4388bf1ac
If you are having issues getting Firebase.plugin to build on iOS, take a look at this issue. https://github.com/TobiasBuchholz/Plugin.Firebase/issues/51
Here is the code I used in my Azure Pipeline to combine the two Apple Certs. https://stackoverflow.com/a/74105887/5360237
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review