Skip to main content
Version: v3

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 App Service file to be started3.0
paramstringN-Parameters passed in during file loading3.0
vibratenumberN0Specify the vibration effect when the notification center pops up, 0 - default, 1 - beep, 2 - birdsong, 3 - drumbeat, 4 - gentle, 5 - buzz3.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'