Xamarin.Forms Android Pushnotification FCM OnMessageReceived not fired when app is background.

Created on 23 Feb 2018  路  2Comments  路  Source: xamarin/Xamarin.Forms

[###] Description
We have Implemented a PN for Xamarin.Forms Application using Azure Notification Hub, it's perfectly fine in IOS.
In Android we received the PN and when is running then OnMessageReceived event fired and it's working but when my app is in background and when I clicked on Notification it will just open the App not fired the OnMessageReceived Event.

Expected Behavior

When App is on background it should fire the OnMessageReceived event.

Actual Behavior

OnMessageReceived not fired when app is on background.

Basic Information

  • Nuget Packages:
    Xamarin.Firebase.Messaging Version: v4.0.30319
    Firebase.Iid Version: v4.0.30319

Files which we used in our project

ZCFirebaseMessagingService.zip

invalid Android

All 2 comments

I believe this is expected. Please refer to https://developer.xamarin.com/guides/android/data-and-cloud-services/google-messaging/remote-notifications-with-fcm/#Implement_FirebaseMessagingService.

Note that OnMessageReceived is invoked for notification messages only when the app is running in the foreground. When the app is running in the background, an automatically generated notification is displayed (as demonstrated earlier in this walkthrough).

Thanks!

@Dhaval8087 Next time please do not open issues related to anything but Xamarin Forms. This repository is not your Stack Overflow.

Was this page helpful?
0 / 5 - 0 ratings