harmony 鸿蒙Notification Overview

  • 2023-02-03
  • 浏览 (601)

Notification Overview

Introduction

All system applications and services can publish notifications through the notification APIs. Users can view the notifications in the notification panel or click a notification to open the publishing application.

Below are some typical use cases for notifications:

  • Display received SMS messages and instant messages.

  • Display push messages, such as advertisements and version updates.

  • Display ongoing events, such as the download progress.

The Advanced Notification Service (ANS) in OpenHarmony is used to manage notifications of various types, such as basic notifications, progress notifications, and reminders published through the background agent.

Notification Service Process

The notification service process involves the notification subsystem, notification sender, and notification subscriber.

A notification is generated by the notification sender and sent to the notification subsystem through inter-process communication (IPC). The notification subsystem then distributes the notification to the notification subscriber.

System applications also support notification-related configuration options, such as switches. The system configuration initiates a configuration request and sends the request to the notification subsystem for storage in the memory and database.

Figure 1 Notification service process en-us_image_0000001466582017

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Notification

harmony 鸿蒙Managing the Notification Badge

harmony 鸿蒙Enabling Notification

harmony 鸿蒙Subscribing to Notifications (for System Applications Only)

harmony 鸿蒙Adding a WantAgent Object to a Notification

harmony 鸿蒙Publishing a Progress Notification

harmony 鸿蒙Publishing a Basic Notification

0  赞