Flutter Push Notifications using flutter firebase messaging with example
Hi Guys, Welcome to Proto Coders Point, In this Flutter Tutorial we will learn how to implement firebase flutter push notifications service in flutter app.
Using which you can send Firebase Cloud messages to your flutter app user using firebase console that is flutter push notifications.
DEMO OUTPUT
flutter firebase push notification example
Let’s start
Flutter Firebase Push Notification
Step 1: Adding Firebase Messaging dependencies
Using this Flutter Plugin we can use the Firebase Cloud Messaging Service (FCM).
With the use of this plugin, your Flutter application will be ready to process and receive the push notification from the firebase console server as well as data messaging on android and iOS devices.
Give a name to your firebase project as “Firebase-Push-Notification”, Just fill all the common required details for creating the firebase project.
2. Add firebase to your android application
Then, After successful creating firebase project, you will see an Add app with list of platform where you can integrate firebase eg : android, iOS, web, unity3D.
Select Android playform
3. Register app with android package name
Came back to IDE (Android Studio) Navigate towords Androidmanifest.xml file to get android package name
buildscript {
repositories {
google() // add this if not there
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3' //add here line
}
}
as shown in the below screenshot
Note: check if google() repositories is added, if not then add it
Then, open build-gradle(app level)
project > Android > app > build-gradle
Add the google services apply plugin
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // add the plugin on top or at the bottom og build-gradle (app-level)