目录

About This Kit

Notification Kit (user notification service) provides a publishing channel for local notifications. With Notification Kit, you can push notifications generated by your application directly to users on the client. Depending on the notification type and publishing scenario, a local notification produces the corresponding ringtone, vibration, banner, lock screen display, automatic screen-on, status bar icon, and display in the notification center.

When to Use

When an application is running, you can use Notification Kit to publish notifications to users.When the application process is terminated, you cannot publish local notifications. Instead, you need to access Push Kit to publish offline notifications on the cloud.

You can use the local notification capability in various scenarios, such as synchronizing upload and download progress, publishing instant customer service and payment notifications, and updating step counts.

Capability Scope

Notification Kit supports the following capabilities:

Service Flow

The main service flow of using Notification Kit is as follows:

  1. Request notification authorization.

  2. Publish a notification to Notification Kit.

  3. Display the notification in the notification center.

Notification Style

The actual display effect depends on the device capabilities and the UI design style of the notification center.

Common notification styles in Notification Kit are as follows.

Type Notification Style Description
Text A maximum of three lines can be displayed in the notification text. Excess content is truncated by an ellipsis (...).
Multi-line text A maximum of three lines of content can be displayed. Excess content of each line is truncated by an ellipsis (...).
Notification badge Displayed as a number in the upper right corner.
Progress bar Progress notification.

Constraints

Penalties for Violations

Both cloud notifications and local notifications published by apps must comply with the Push Kit message classification standards. Incorrect message classification or other violations of these standards will be considered violations. For the classification standards for local notifications, see Notification Slots.

For violations and the corresponding measures, see Push Notification Violation Penalty Criteria.

Supported Emulators

This kit is supported on the Emulator.

There are some general differences between the Emulator and real devices. For details, please refer to Differences Between the Emulator and the Real Device.