2022-03-15
2896
#firebase#flutter
Souvik Biswas
34925
Mar 15, 2022 â‹… 10 min read

Add Flutter push notifications with Firebase Cloud Messaging

Souvik Biswas Mobile developer (Android, iOS, and Flutter), technical writer, IoT enthusiast, avid video game player.

Recent posts:

Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 min read
View all posts

22 Replies to "Add Flutter push notifications with Firebase Cloud Messaging"

  1. That’s version 7 of FirebaseMessaging. The lastest version 9 it’s completely different. It requires to be configured with streams. Also you can’t instantiate FirebaseMessaging anymore and you can’t get tokens like that. I readed the documentation but I can’t implement it. I thought this tutorial was updated but it’s not.

    1. Have you found a way to implement yet? I hate how bad at documentation google is. It’s too mixed with web, ios, android, etc

  2. Hello sir ,
    I used your code and every thing running successfully but notification are not showing > on message method also not able to calling .

  3. Everything works fine with this even in Firebase Messaging 11.2.11 however there is an issue with the line:

    FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler)

    throwing an exception:

    _CastError (Null check operator used on a null value)

    It only does this on Android, not on iOS. I don’t have an Android device to check with so it might be because I’m running on the Android simulator? Any clarification welcome. Thanks!

  4. A big “Thank You” for this detailed guide
    _firebaseMessagingBackgroundHandler is received notification data and print on console, however, app in background or terminated remains in background / terminated. pls what am i doing wrong? my expectation is that app should pop up from background or wake up from termination.

    I want to received backgroundmessage and launch a specific screen.
    According to documentation, “Since the handler runs in its own isolate outside your applications context, it is not possible to update application state or execute any UI impacting logic.”

    I came across service extension but no clear guideline for implementation

  5. Nice post man. but i have 2 questions:

    – How to subscribe to a default topic automatic? where the best place to do that?
    – What can I do to see if token are refreshed? Some event like OnTokenRefresh, I want to do some http request

  6. Nice one sir. Very resourceful and the flow is quite explanatory. The author missed out calling the registerNotification() function in the initState() method, after adding that, everything works nice

Leave a Reply