| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| title | string | 必填 | 标题 |
| content | string | 必填 | 内容 |
| options | object | 选填 | 默认值:{showOnLockScreen: false, enableVibration: false},showOnLockScreen表示是否显示在锁屏上,enableVibration表示是否震动 |
例子:
function main() {
var id = Notification.show('标题', '内容')
console.log('id:', id)
}
| 参数名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| id | integer | 必填 | 通知id,调用show函数的返回值即为id |
例子:
function main() {
Notification.cancel(1000)
}