Closed MCAleckson closed 1 year ago
I found my problem.
In his Legacy documentation (which applies to my case since though I'm using .Net7 I'm not using MAUI) Tobias says:
"Take a look at the documentation for the Xamarin.Firebase.iOS.CloudMessaging packages, because Plugin.Firebase's code is abstracted but still very similar."
Indeed.
I was not properly using Messaging.SharedInstance... as those documents depict.
For instance,
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// With swizzling disabled you must let Messaging know about the message, for Analytics
Messaging.SharedInstance.AppDidReceiveMessage (userInfo);
// Print full message.
Console.WriteLine(userInfo);
}
So I'll echo here - if you're trying to use Tobias' plugins with Xamarin or Platform.Uno or something other than Maui - pay close attention to the documentation in the Legacy branch and to the other documents linked there.
Thanks!
My Platform.UNO Android app using this plugin for Firebase both receives a Firebase token and successfully receives push notifications.
However, in IOS, I only get the Firebase token as displayed during the firing of the TokenChanged event. The NotificationReceived event never fires when I send a notification through Firebase via Postman.
One thing's for sure - I'm clearly confused on registering the IOS/Platform.Uno app for notifications as the "UNUserNotificationCenter.Current.Delegate" shows in this IOS code to initialize Firebase and set the event handlers.
Thanks in advance for any help you can give.