Flutterfire: [firebase_messaging] Add foreground push notifications to firebase_messaging example app

Created on 13 Oct 2019  路  3Comments  路  Source: FirebaseExtended/flutterfire

The firebase_messaging plugin's example app has the code set up with event handlers for foreground push notifications, but they don't actually work; you don't receive any notifications unless the app is closed/in the background. From reading the Firebase Messaging documentation, it seems there is extra configuration that has to be done to receive notifications and data in the foreground:

Add the following to your app's manifest:

A service that extends FirebaseMessagingService. This is required if you want to do any message handling beyond receiving notifications on apps in the background. To receive notifications in foregrounded apps, to receive data payload, to send upstream messages, and so on, you must extend this service.

I'm not sure how to do that in Flutter, and it seems to have been left out of the example app.

crowd messaging bug documentation

Most helpful comment

hello.. any update, please? thank you 馃檹

All 3 comments

@Herohtar

The issue at https://github.com/flutter/flutter/issues/15542 has been closed and moved here. Future collaboration on this issue will be done here.

hello.. any update, please? thank you 馃檹

Hey all 馃憢

As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues. The example app does now have examples of Foreground notifications (for iOS only) as well as channels for Android.

If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.

Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin.

Thanks everyone.

Was this page helpful?
0 / 5 - 0 ratings