Skip to main content
Version: v3.x

notify

Start from API_LEVEL 3.0 . Please refer to API_LEVEL.

Send notifications to the Watch Notification Center.

info

permission code: device:os.notification

Type​

function notify(option: Option): Result

Parameters​

Option​

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
titlestringY-Notice title text3.0
contentstringY-Text of the notice3.0
actionsArray<Action>Y-Custom button arrays3.0

Action​

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
textstringY-Button Text3.0
filestringY-The jump page after the button is clicked or the background service file to be started3.0
paramstringN-Parameters passed in during file loading3.0

Result​

TypeDescription
numberThe result of the notification delivery, returns 0 for delivery failure, the rest of the result indicates the ID of the notification

Example​

import { notify } from '@zos/notification'