Notifications are messages or alerts that inform a user about some recent event, update, or vital time-sensitive information. Notifications can be visual( like pop-ups), auditory (like a ringtone), or a combination of both.

Notifications can be categorized by importance, such as high or low priority. Users can customize when they receive notifications. Notifications can be synchronized across all user-logged-in devices.

Notifications can appear on devices such as smartphones, tablets, computers, and smartwatches. Some commonly known notifications are:

  1. Pop-Up Notifications
  2. Toast Notifications
  3. In-Line Notifications
  4. Push Notifications
  5. Interactive Notifications
  6. Event-Based Notifications
  7. Error and warning Notifications

Key highlights

  • In-app notifications can generally be classified into local and push notifications on the basis of how they are generated and delivered.
  • Local notifications are displayed by the app itself.
  • Push notifications are sent from a server to the user’s device.
  • Both types of notifications can be customized and personalized according to the user’s preferences.
  • Push notification is seen to be more advantageous because it can reach its users even when the app is not being used actively.

What is a Local Notification?

Local notifications are those kind of notifications which are generated and displayed by the app itself. These notifications do not require any external servers or internet connection to be displayed. They are typically triggered by the apps based on certain events that occur in the app or device.

The various types of local notifications are:

Types Sub-types
1. Pop-up Notification
  1. Dialogs
  2. Alerts
2. Toast Notifications
  1. Top/Bottom Banners
  2. Toast Notifications
3. Badges
  1. Icon Badges
  2. Tab Badges
4. In-Line Notifications
  1. Embedded Messages
  2. Contextual Tooltips
5. Progress Indicators
  1. Loading Bars
  2. Step Progress
6. Event-based Notifications
  1. Trigger Notifications
  2. Behavioral Notifications
7. Reminder Notifications
  1. Scheduled Reminders
  2. Recurring Notifications
8. Error and Warning Notifications
  1. Error Messages
  2. Warning Alerts

How Do Local Notifications Function?

In this article, we will be looking at how local notifications work in Flutter Apps using the flutter_local_notifications package. Local Notifications operate in the following steps:

1. Scheduling

In the beginning, all the necessary notification plugins are imported. A Notification manager is created to manage local notifications on the device. Plugins for both Android and iOS devices are set along with a specialized icon associated with notifications.

Finally, the device’s operating system’s notification framework is used to carry out the scheduling process.

The schedule method of FlutterLocalNotificationPlugin class is used.

2. Triggering

When the pre-determined conditions are met or certain events occur at a set time, the operating system triggers the notification.

3. Displaying

Once the notification is triggered on the app’s system, it is displayed on the user’s screen in the form of pop-up texts, banners, badges, or sounds depending upon the user’s settings on the gadget.

The technical way to do this is by using the show method of FlutterLocalNotificationPlugin class.

4. Interaction

Once the notification is received, users can either choose to dismiss it by swiping or crossing it out. Or, the user can interact with it by tapping on it, which leads to the app where the full information is displayed and is ready to be taken action on. Users can immediately respond to these important notifications.

5. Handling

When the user interacts with the notification, the app receives data on all the activities. If the user selects to perform a certain task in response to the information received from the notification, the app carries it out smoothly and effectively. 

The app is also responsible for storing and updating user information and sends out further notifications and messages if required.

The onSelectNotification callback function is called when the user taps on the notification.

What is a Push Notification?

Push Notifications are those messages and information that are generated and sent out by a remote server to the user through an internet connection. These notifications are triggered in response to user activity or a new update from the source. 

These notifications can be images, videos, and links and can be scheduled for specific hours based on some specific event. Push Notifications are easy to customize and allow for more personalized and segmented messaging.

The different types of push notifications are as follows:

Types Sub-types
1. In-App Push Notifications  In-App Push Messages
2. Activity Feeds
  1. Notification Center
  2. Activity Stream
3. Interactive Notifications
  1. Actionable Prompts
  2. Swipeable Actions

How Do Push Notifications Function?

Push notifications operate in the following steps:

1. User Opt-In

Initially, the user must choose to receive push notifications from the server or cloud service. This can be done by changing the settings or when the app asks for permission.

2. Registration

When the user opts in, the app registers with a push notification service such as Apple Push Notification Service or Firebase Cloud Messaging service. These services provide a unique identifier for the device.

3. Sending Notifications

Either the app server or the designated third-party server sends a push notification request to the push notification service. The request includes device identifier and notification content.

4. Delivering Notifications

The push notification service delivers a message to the selected device on the basis of the device token. The path involves routing through multiple servers as well as computer networks.

5. Displaying Notifications

When the device receives the notification, it is at first processed by the operating system and then displayed. The notification can be either a text alert, vibration alert, or sound based on the user’s notification settings.

6. Handling Notifications

The app must smoothly handle the interactions between the user and the notification. The app must also commit actions and updates to its database and servers efficiently.

Local Notification vs Push Notification: Key Differences

One similarity is that event-based notifications and reminders can be either local or push, depending upon the app’s design. The differences, however, are as follows:

Local Notification Push Notification
The app sets it off on the device. It is sent from a server to the user’s device.
It will work whether the app is open or not. The notifications will not be displayed if the app is not running in the background.
It doesn’t require an internet connection. It requires an active internet connection.
The notifications pop up only on a particular device. The notifications pop up on all synced devices.
It is triggered by in-app events such as reminders. It is triggered by server-side events such as updates.
It is limited to device settings. It can be customized according to user data and behavior.
It is mainly used to display scheduled events. It is mainly used for delivering real-time information. 
It is limited to one particular device. Cross-device synchronization is possible.
The security and privacy are managed locally on the device. The security is managed on the server side.
There is no chance of lagging. There are chances of delay.
Example use cases: Alarms, reminders, app-specific alerts, etc. Example use cases: Updates, social media alerts, news alerts, etc.

Use Cases of Local and Push Notification

One of the most important use cases of Push notifications is Emergency Alerts.

Emergency alerts are notifications sent by designated authorities like government agencies or emergency services to the public to immediately inform them about ongoing or imminent emergencies. They bypass standard notification settings on gadgets and have a broad reach.  

These notifications enable the receiver to take immediate action for their safety and well-being. Some Examples of Emergency Alert systems are Severe Weather Alerts, Public Health Alerts, Civil Emergency Messages, and AMBER Alerts.

When it comes to Local Notifications, a Reminder seems to be predominant. Most apps have the feature of a reminder alert that allows user to receive timely alerts on their upcoming tasks, deadlines, events, and so on.

These notifications can be received even when there is no internet or app running in the background.Alarms and pop-up messages ensure time management and productivity. 

Examples: Subscription renewal reminders, payment due reminders, medication time reminders, appointment reminders, etc.

Final Words

In a nutshell, notifications should be selected and customized based on user preferences and must comply with the guidelines and regulations. If instant functionality and predictability are preferred, then local notification must be selected. But if real-time communication and high user engagement are preferred, then push notifications must be used.

Selection of the right factors while choosing between local and push notifications ensures that both serve their intended purpose effectively and efficiently.

FAQs

1. What are the 3 types of notifications in Android?

The main 3 types of Android notifications are:

  1. Standard Notifications 

Standard notifications can be brief messages such as text messages, email alerts, app updates, etc.

  1. Heads-Up Notifications

Heads-up notifications have buttons for quick responses. These include time-sensitive pieces of information such as urgent phone calls, chat alerts from messaging apps, etc.

  1. Ongoing Notifications

Ongoing notifications are displayed until the users themselves dismiss them. Notifications for active downloads, music playing, navigation directions, phone system updates, etc., are some examples.

2. What is the difference between push and polling notification?

Some of the key differences can be listed as follows:

Push Notification Poll Notification
Push notifications are directly sent from the server to the user without the need for periodic requests. The device needs to make periodic requests to the server to check for updates.
They provide real-time updates. Since the user first needs to check for updates, the updates may not be immediate.
Since these notifications don’t require constant checks, the battery is greatly saved. These notifications have a high impact on battery life due to constant connectivity checks.
Users can act immediately upon receiving these notifications. User’s actions might be delayed due to a delay in the reception of these notifications.

                

3.  What is the opposite of push notification?

The opposite of push notification is a pull notification. Pull notifications are reactive in nature. That means that a user “pulls” or requests an update from the server. It is done by refreshing an app to update information. Example: Refreshing an Email box, Checking social media feeds, etc.

4. Are push notifications more secure than local notifications?

Each notification type seems to fall behind in its way when it comes to security. Since push notifications come from the server itself, there are high chances of sensitive data being intercepted leading to breaches in encryption and authentication procedures. 

However, local notifications are a bit more secure as there is no external communication involved during data transmission. But for it to be more secure, the device’s overall security must be reliable.

5. What is the difference between remote and local mode?

Remote mode notifications are generated by a server and sent over to the user through the internet connection. The source can be a server or a cloud service. These notifications can be sent even when the app is not running. Examples: Apple Push Notification (APN) and Firebase Cloud Messaging (FCM) Notification.

Local mode notifications are generated and sent by the app itself without any requirement for an internet connection. The notifications are triggered by certain conditioned or time-based events. Examples: Reminders, Fitness check alerts, Alarms, etc.

Prasanta Raut

Prasanta is the founder and visionary CEO of Dialaxy. He is on a mission to redefine the landscape of SaaS solutions, infusing creativity and ingenuity into every aspect of Dialaxy’s offerings. His fervent dedication to simplifying sales and support processes drives Dialaxy’s forward momentum, delivering unparalleled value to businesses of all sizes. Embark on a transformative journey with Prasanta and Dialaxy as they pave the way for a new era of sales and support excellence.

Prasanta is the founder and visionary CEO of Dialaxy. He is on a mission to redefine the landscape of SaaS solutions, infusing creativity and ingenuity into every aspect of Dialaxy’s offerings. His fervent dedication to simplifying sales and support processes drives Dialaxy’s forward momentum, delivering unparalleled value to businesses of all sizes. Embark on a transformative journey with Prasanta and Dialaxy as they pave the way for a new era of sales and support excellence.