Push Notifications — Flutter

Farrukh Sajjad
2 min readSep 12, 2020

flutter push notifications sample notification sample

First of all make sure that your app is linked with a Firebase account.

NOTE: This is only the initial phase into push notifications (Manual Notifications from Firebase).

Add firebase_messaging dependency in pubspec.yaml file:

firebase_messaging: ^7.0.0

Then you need to import firebase_messaging dependency in your required .dart file.

import ‘package:firebase_messaging/firebase_messaging.dart’;

flutter push notifications using firebase_messaging dependency

Go to CLOUD MESSAGING in your Firebase console.

push notifications in flutter using cloud messaging in firebase

Fill in your sample notification to send.

Click on Send Text Message, following dialogue will appear:

testing flutter push notifications

Copy the token number which is printed in the debug console and add in the above above text field.

Fill in the check box and click on test.

“MAKE SURE THAT YOUR APP IS CLOSED ON YOUR EMULATOR OR PHYSICAL DEVICE”

HERE IS THE FINAL OUTPUT:

flutter push notifications example sample

Enjoy!

Stay tuned for Automatic Push Notifications.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Farrukh Sajjad
Farrukh Sajjad

Written by Farrukh Sajjad

Noob Game Dev | Back to posting weekly

No responses yet

Write a response