FCM push notifications FLUTTER when app is terminated

3,762

first answer, I hope will be good.

As you can see here notifications are handled with onBackgroundMessage even if the app is terminated. Maybe your problem is that you are not sending a Notification but a "Data only" message. In that case you have to set the field "priority": "high"

Also, with the latest release of Flutter and firebase_messaging the methods onResume, onMessage and onLaunch are deprecated. You should substitute them with onMessage, onMessageOpened, onBackground, but you can find definitely more info with the official documentation

Share:
3,762
kingkobain99
Author by

kingkobain99

Updated on December 28, 2022

Comments

  • kingkobain99
    kingkobain99 over 1 year

    I am trying to receive push notifications on ANDROID from the Firebase console when the app is terminated but I get nothing (I have onResume, onMessage and onLaunch callback listeners but I don’t even want to handle them in the app yet) I’d just like to get them to show In the tray or lock screen. Is there some Android configuration required?

  • gowtham6672
    gowtham6672 over 2 years
    thanks. i always forget this