0

I am looking for a event for on notification receive event it looks like this exists in firebase but I can't find a implementation for Xamarin

https://firebase.google.com/docs/cloud-messaging/android/receive

Does this just not exist ?

Micah Armantrout
  • 6,781
  • 4
  • 40
  • 66
  • https://learn.microsoft.com/en-us/xamarin/android/data-cloud/google-messaging/remote-notifications-with-fcm?tabs=windows#implement-firebasemessagingservice – Jason Apr 20 '21 at 15:35
  • Sweet exactly what I wanted can you put that as a answer ? Is is possible to do the same on IOS ? – Micah Armantrout Apr 20 '21 at 15:39

1 Answers1

1

this is covered in the docs

[Service]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
public class MyFirebaseMessagingService : FirebaseMessagingService
{
    const string TAG = "MyFirebaseMsgService";
    public override void OnMessageReceived(RemoteMessage message)
    {
        Log.Debug(TAG, "From: " + message.From);
        Log.Debug(TAG, "Notification Message Body: " + message.GetNotification().Body);
    }
}
Jason
  • 86,222
  • 15
  • 131
  • 146