You are on page 1of 29

NOTIFICATION

LOCAL & PUSH


PRESENTED BY THE RICHTOFENS
CONTENT
Intro to notification

Local Notification

Local Notification Implementation

Push Notification

Push Notification Implementation

Differences
INTRO TO NOTIFICATION
A notification is a message that displays outside

your app's UI to provide the user with reminders,

communication from other people, or other timely

information from your app. Users can tap the

notification to open your app or take an action

directly from the notification.


Appearances on a device

Heads-up
Lock screen Wear OS
Notification drawer notification
LOCAL NOTIFICATION
With local notifications, your app configures the

notification details locally and passes those details

to the system, which then handles the delivery of the

notification when your app is not in the foreground


LOCAL NOTIFICATION
1.ADDING DEPENDENCIES TO THE FLUTTER APP
The first step is to run the command below in your terminal to add the

latest version of flutter_local_notifications to your pubspec.yaml file.


LOCAL NOTIFICATION
1.CREATE A NEW CLASS
This class will handle all notification logic, at first you should create an instance

of FlutterLocalNotificationsPlugin then initialize it.


LOCAL NOTIFICATION
2.CONFIGURING ANDROID INITIALIZATION SETTINGS
To configure the Android initialization settings, we need to pass in a single required argument,

which is the app icon that would be displayed in the notification bar, and we need to add our

icon as a drawable resource to the Android head project.

full path: YOUR_APPLICATION_FOLDER\android\app\src\main\res\drawable\app_icon.png

The next step is to create an InitializationSettings object. This plugin is used to initialize settings

for both Android and iOS platforms, Generally, the InitializationSettings has three named optional

parameters, android, iOS, and macOS, and they take in the corresponding platform initialization

settings arguments.

The next step is to call the initialize method on the FlutterLocalNotificationsPlugin object. This

method takes in two arguments, the InitializationSettings object and the onSelectNotification

property, The onSelectNotification property takes in a callback function that will be triggered

when the notification is tapped.


LOCAL NOTIFICATION
DISPLAYING LOCAL NOTIFICATION IMPLEMENTATION
LOCAL NOTIFICATION
DISPLAYING LOCAL NOTIFICATION IMPLEMENTATION
LOCAL NOTIFICATION
DISPLAYING LOCAL NOTIFICATION IN FLUTTER
To display a notification, we need to create a platform-specific NotificationDetails instance,

which takes in arguments that are unique to each platform, AndroidNotificationDetails handles

the configuration of notifications in Android devices. It takes in several arguments, like

channelID, channelName, channelDescription, priority, importance, and so on.

Next we need to call the show method of the FlutterLocalNotificationsPlugin. The show method

is responsible for creating push notifications, and it expects some arguments like id, title, body,

notificationDetails, and payload.

id: unique identifier of a notification

title: title for the notification

body: the notification message

notificationDetails: where we pass in the notificationDetails object

payload: holds the data that is passed through the notification when the notification is tapped
LOCAL NOTIFICATION
SCHEDUALING LOCAL NOTIFICATION IN FLUTTER
Scheduling notifications, is same as showing notifications , with addition to an interval , where

your notification will be shown in that interval, we need to call the periodicallyShow method of

the FlutterLocalNotificationsPlugin , and we should add interval to it


LOCAL NOTIFICATION
DISPLAYING LOCAL NOTIFICATION IMPLEMENTATION
PUSH NOTIFICATION
A push notification is a message that pops up on a

mobile device. App publishers can send them at any

time; users don’t have to be in the app or using their

devices to receive them.


PUSH NOTIFICATION
For app publishers, push notifications are a way to

speak directly to a user. They don’t get caught in

spam filters, or forgotten in an inbox — click-through

rates can be twice as high as email. They can also

remind users to use an app, whether the app is

open or not.
PUSH NOTIFICATION
1.CREATE FLUTTER PROJECT THEN FIRBASE PROJECT
PUSH NOTIFICATION
2.IN FIRBASE PORTAL GO TO MESSAGING AND START
INTEGRATING TO ANDROID
PUSH NOTIFICATION
3.THEN REGITER YOUR APP
You can find this in
root>android>app>build.gradle
search for applicationID

PUSH NOTIFICATION
4.DOWNLOAD CONFIG FILE AND ADD IT TO YOUR
PROJECT
PUSH NOTIFICATION
5.ADD THE FOLLOWING CODE TO YOUR PROJECT
PUSH NOTIFICATION
5.ADD THE FOLLOWING CODE TO YOUR PROJECT
PUSH NOTIFICATION
5.ADD THE FOLLOWING CODE TO YOUR PROJECT
PUSH NOTIFICATION
6.CLICK ON SEND YOUR FIRST MESSAGE AND ENTER
YOUR DATA
PUSH NOTIFICATION
7.SELECT YOUR APPLICATION ON TARGET AND NEXT
PUSH NOTIFICATION
8.SCHEDULE YOUR NOTIFICATION AND CLICK REVIEW
PUSH NOTIFICATION
9.PUBLISH YOUR NOTIFICTIOIN
PUSH NOTIFICATION
LOCAL NOTIFICATION PUSH NOTIFICATION
can be triggered by date, time and Server or cloud-service

place sent by a remote server (its provider)

scheduled by an app locally and are


which sends these notifications to

delivered by the same device.


devices on which the app is installed.
well suited for apps to alert the user at
appropriate when app’s data is
a specific time or when a specific
managed by your company’s servers.
location is reached.
Aimed at disengaged users.
Deals with users who are already

engaged and using the product.


THANK YOU!
IF YOU HAVE ANY QUESTIONS EMAIL US

RICKTOFENS@GMAIL.COM

You might also like