Version: 1.3
语言 : 中文
Ads Service
Android

Notification Service

Notification Service (user notification service) provides a local notification publishing channel, which can be used to push notifications generated by the application directly to users on the client.

For more information, you can click the following link to reach directly:

Notification Service config

To integrate with Notification service:

  1. Open the OpenHarmonySDKKitsSettings window.

  2. Fill in the common configuration include client_id, app_id, Bundle Name.

  3. Check the Notification Kit.

  4. Click on Open Scene to open the demo scene with the interface integrated, and operate each function in the scene.

    Check the Noti Kit
    Check the Noti Kit

Notification Service demo scene

To open the Notification Service demo scene in the Tuanjie Editor: OpenHarmonySDKKits > OpenHarmonySDKKitsSettings > Notification Kit > Open Scene.

There are many types of Notifications. This kit only implements the posting and canceling of text notifications.

Notification Scene
Notification Scene

The functions of buttons and their calling interfaces are as follows:

Area Description
Publish Noti Click to pop up a pop-up window where you can enter the field for posting normal text notifications.
Cancel Noti Click to pop up a pop-up window, and the drop-down list will show the current notifications. Select the corresponding notification to delete.
Output Log The relevant log will be displayed here.
Notification Publish
Notification Publish
Notification Cancel
Notification Cancel

Export and build

To run the demo on the OpenHarmony devices:

  1. Open the OpenHarmonySDKKitsSettings window.
  2. Make sure client_id, app_id and Bundle Name have been filled correctly. Make sure Notification Kit have been checked.
  3. Open the Build Settings window.
  4. Switch to OpenHarmony platform and check Export Project.
  5. Export project.
  6. Open the exported project in DevEco, build and run on OpenHarmony device.
Ads Service
Android