diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md index c8841f24348e99e23dbc3f282f220948adf7ccdf..a88e87d9f0fc13bc05a30e6929b4e583d051c385 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md @@ -476,6 +476,10 @@ queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: As 以异步方法根据给定的意图获取Ability信息,使用callback形式返回结果。 +**系统能力:** + +SystemCapability.BundleManager.BundleFramework + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -509,6 +513,10 @@ queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback 以异步方法通过uid获取对应的包名,使用Promise形式返回结果。 +**系统能力:** + +SystemCapability.BundleManager.BundleFramework + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -728,6 +740,10 @@ getNameForUid(uid: number, callback: AsyncCallback): void; 以异步方法通过uid获取对应的包名,使用callback形式返回结果。 +**系统能力:** + +SystemCapability.BundleManager.BundleFramework + **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -748,9 +764,10 @@ bundle.getNameForUid(uid, (err, data) => { }) ``` - ## ElementName + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ----------- | -------- | ------ | ---- | ------------------------------------------------------------ | | deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | @@ -761,6 +778,8 @@ bundle.getNameForUid(uid, (err, data) => { ## InstallStatus + **系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ------------- | -------- | ---------------- | ---- | ------------------------------------------------------------ | | status | 只读 | InstallErrorCode | 是 | 安装结果code
SUCCESS = 0
STATUS_INSTALL_FAILURE = 1
STATUS_INSTALL_FAILURE_ABORTED = 2,
STATUS_INSTALL_FAILURE_INVALID = 3
STATUS_INSTALL_FAILURE_CONFLICT = 4
STATUS_INSTALL_FAILURE_STORAGE = 5
STATUS_INSTALL_FAILURE_INCOMPATIBLE = 6
STATUS_UNINSTALL_FAILURE = 7
STATUS_UNINSTALL_FAILURE_BLOCKED = 8
STATUS_UNINSTALL_FAILURE_ABORTED = 9
STATUS_UNINSTALL_FAILURE_CONFLICT = 10
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C
STATUS_RECOVER_FAILURE_INVALID = 0x0D
STATUS_ABILITY_NOT_FOUND = 0x40
STATUS_BMS_SERVICE_ERROR = 0x41
STATUS_FAILED_NO_SPACE_LEFT = 0x42
STATUS_GRANT_REQUEST_PERMISSIONS_FAILED = 0x43
STATUS_INSTALL_PERMISSION_DENIED = 0x44
STATUS_UNINSTALL_PERMISSION_DENIED = 0x45 | @@ -769,6 +788,8 @@ bundle.getNameForUid(uid, (err, data) => { 包的标志 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 默认值 | 说明 | | ------ | ------ | ------ | | GET_BUNDLE_DEFAULT | 0x00000000 | 获取默认的应用信息 | @@ -788,6 +809,8 @@ bundle.getNameForUid(uid, (err, data) => { 包的选项 + **系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | userId | number | 是 | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | @@ -796,6 +819,8 @@ bundle.getNameForUid(uid, (err, data) => { 应用包的信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | name | string | 是 | 否 | 应用包的名称 | @@ -826,6 +851,8 @@ bundle.getNameForUid(uid, (err, data) => { 应用程序信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | name | string | 是 | 否 | 应用程序的名称 | @@ -854,6 +881,8 @@ bundle.getNameForUid(uid, (err, data) => { 应用程序的模块信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | moduleName | string | 是 | 否 | 模块名称 | @@ -863,6 +892,8 @@ bundle.getNameForUid(uid, (err, data) => { 自定义元数据 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ----- | ------ | ---- | ---- | ---------------- | | name | string | 是 | 是 | 自定义元数据名称 | @@ -874,6 +905,8 @@ bundle.getNameForUid(uid, (err, data) => { Hap模块信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | name | string | 是 | 否 | 模块名称 | @@ -897,6 +930,8 @@ Hap模块信息 应用运行时需向系统申请的权限集合的详细信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | name | string | 是 | 是 | 需要使用的权限名称 | @@ -907,6 +942,8 @@ Hap模块信息 描述权限使用的场景和时机 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | abilities | Array | 是 | 是 | 使用到该权限的Ability集合 | @@ -917,6 +954,8 @@ Hap模块信息 Ability信息 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 可读 | 可写 | 说明 | | ------ | ------ | ------ | ------ | ------ | | bundleName | string | 是 | 否 | 应用包名 | @@ -951,6 +990,8 @@ Ability信息 Ability类型 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 说明 | | ------- | ---- | --------------------------- | | UNKNOWN | 无 | 未知Ability类型 | @@ -962,6 +1003,8 @@ Ability类型 屏幕显示方向 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 说明 | | ------------- | ---- | ------------------------ | | UNSPECIFIED | 无 | 屏幕方向--不指定 | @@ -973,6 +1016,8 @@ Ability类型 启动模式 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 说明 | | ----------- | ---- | ------------------- | | SINGLETON | 0 | Ability只有一个示例 | @@ -982,6 +1027,8 @@ Ability类型 Ability的子类型 + **系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + | 名称 | 类型 | 说明 | | ----------- | ---- | ----------------------------- | | UNSPECIFIED | 0 | 未定义Ability子类型 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md b/zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md index 7e0470b09ba94fb61061c1b60851664db87c5f2f..a624b6ca6e3f2d0fdee97f492e0862fbe9db8196 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-backgroundTaskManager.md @@ -191,12 +191,13 @@ startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: Want **系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - **参数**: + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | context | Context | 是 | 应用运行的上下文 | | bgMode | BackgroundMode | 是 | 向系统申请的后台模式 | - | wantAgent | [WantAgent](js-apis-notification.md#WantAgent接口) | 是 | 通知参数,用于指定长时任务通知点击跳转的界面 | - +| wantAgent | [WantAgent](js-apis-notification.md#WantAgent接口) | 是 | 通知参数,用于指定长时任务通知点击跳转的界面 | + - **返回值** | 类型 | 说明 | | -------------- | ------------------------- | @@ -295,14 +296,16 @@ backgroundTaskManager.stopBackgroundRunning(featureAbility.getContext()).then(() ## BackgroundMode 8+ +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + | 参数名 | 参数值 | 描述 | | ----------------------- | -------- | -------- | -| DATA_TRANSFER | 1 | 数据传输
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| AUDIO_PLAYBACK | 2 | 音频播放
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| AUDIO_RECORDING | 3 | 录音
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| LOCATION | 4 | 定位导航
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| BLUETOOTH_INTERACTION | 5 | 蓝牙相关
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| MULTI_DEVICE_CONNECTION | 6 | 多设备互联
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| WIFI_INTERACTION | 7 | WLAN相关(系统保留)
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| VOIP | 8 | 音视频通话(系统保留)
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | -| TASK_KEEPING | 9 | 计算任务(仅供PC使用)
**系统能力:** SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask | \ No newline at end of file +| DATA_TRANSFER | 1 | 数据传输 | +| AUDIO_PLAYBACK | 2 | 音频播放 | +| AUDIO_RECORDING | 3 | 录音 | +| LOCATION | 4 | 定位导航 | +| BLUETOOTH_INTERACTION | 5 | 蓝牙相关 | +| MULTI_DEVICE_CONNECTION | 6 | 多设备互联 | +| WIFI_INTERACTION | 7 | WLAN相关(系统保留) | +| VOIP | 8 | 音视频通话(系统保留) | +| TASK_KEEPING | 9 | 计算任务(仅供PC使用) | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md index 09fa471f41b6d6e78803364275a2ccbbb3fa2d09..cab69b7c18df08df20dd516b1e1928585913b909 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEvent.md @@ -251,8 +251,8 @@ publishAsUser(event: string, userId: number, options: CommonEventPublishData, ca ```js //公共事件相关信息 var options = { - code: 0; //公共事件的初始代码 - data: "initial data";//公共事件的初始数据 + code: 0, //公共事件的初始代码 + data: "initial data",//公共事件的初始数据 } //发布公共事件回调 @@ -541,34 +541,40 @@ CommonEvent.unsubscribe(subscriber, UnsubscribeCallBack); ## CommonEventPublishData -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| --------------------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| bundleName | 只读 | string | 否 | 表示包名称
**系统能力**:SystemCapability.Notification.CommonEvent | -| code | 只读 | number | 否 | 表示公共事件的结果代码
**系统能力**:SystemCapability.Notification.CommonEvent | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据
**系统能力**:SystemCapability.Notification.CommonEvent | -| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限
**系统能力**:SystemCapability.Notification.CommonEvent | -| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件
**系统能力**:SystemCapability.Notification.CommonEvent | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息
**系统能力**:SystemCapability.Notification.CommonEvent | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent + +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| --------------------- | -------- | -------------------- | ---- | ---------------------------- | +| bundleName | 只读 | string | 否 | 表示包名称 | +| code | 只读 | number | 否 | 表示公共事件的结果代码 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据 | +| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限 | +| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | ## CommonEventSubscribeInfo +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent + | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ------------------- | -------- | -------------- | ---- | ------------------------------------------------------------ | -| events | 只读 | Array\ | 是 | 表示要发送的公共事件
**系统能力**:SystemCapability.Notification.CommonEvent | -| publisherPermission | 只读 | string | 否 | 表示发布者的权限
**系统能力**:SystemCapability.Notification.CommonEvent | -| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID
**系统能力**:SystemCapability.Notification.CommonEvent | -| userId | 只读 | number | 否 | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。
**系统能力**:SystemCapability.Notification.CommonEvent | -| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000
**系统能力**:SystemCapability.Notification.CommonEvent | +| events | 只读 | Array\ | 是 | 表示要发送的公共事件 | +| publisherPermission | 只读 | string | 否 | 表示发布者的权限 | +| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID | +| userId | 只读 | number | 否 | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。 | +| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000 | ## CommonEventData -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ---------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| event | 只读 | string | 是 | 表示当前接收的公共事件名称
**系统能力**:SystemCapability.Notification.CommonEvent | -| bundleName | 只读 | string | 否 | 表示包名称
**系统能力**:SystemCapability.Notification.CommonEvent | -| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据
**系统能力**:SystemCapability.Notification.CommonEvent | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据
**系统能力**:SystemCapability.Notification.CommonEvent | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息
**系统能力**:SystemCapability.Notification.CommonEvent | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent + +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ---------- | -------- | -------------------- | ---- | ------------------------------------------------------- | +| event | 只读 | string | 是 | 表示当前接收的公共事件名称 | +| bundleName | 只读 | string | 否 | 表示包名称 | +| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据< | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | ## CommonEventSubscriber diff --git a/zh-cn/application-dev/reference/apis/js-apis-environment.md b/zh-cn/application-dev/reference/apis/js-apis-environment.md index 21898fc226a0b375069d5a3d6776d2e2d75acc12..21054a3ac753ea97447e8f57b2b54fbaee0fd459 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-environment.md +++ b/zh-cn/application-dev/reference/apis/js-apis-environment.md @@ -9,16 +9,16 @@ import environment from '@ohos.environment'; ``` -## 系统能力 - -SystemCapability.FileManagement.File.Environment - ## environment.getStorageDataDir getStorageDataDir():Promise<string> 异步方法获取内存存储根目录,以promise形式返回结果。 +- 系统能力: + + SystemCapability.FileManagement.File.Environment + - 返回值: | 类型 | 说明 | @@ -41,6 +41,10 @@ getStorageDataDir(callback:AsyncCallback<string>):void 异步方法获取内存存储根目录,以callback形式返回结果。 +- 系统能力: + + SystemCapability.FileManagement.File.Environment + - 参数: | 参数名 | 类型 | 必填 | 说明 | @@ -61,6 +65,10 @@ getUserDataDir():Promise<string> 异步方法获取公共文件根目录,以promise形式返回结果。 +- 系统能力: + + SystemCapability.FileManagement.File.Environment + - 返回值: | 类型 | 说明 | @@ -83,6 +91,10 @@ getUserDataDir(callback:AsyncCallback<string>): void 异步方法获取公共文件根目录,以callback形式返回结果。 +- 系统能力: + + SystemCapability.FileManagement.File.Environment + - 参数: | 参数名 | 类型 | 必填 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md b/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md index fc08a9259f89a95635ff795ccfb5e0771051b421..0429806e44791a143ced57fecf0f54126757746d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md +++ b/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md @@ -23,16 +23,16 @@ createFormBindingData(obj?: Object | string): FormBindingData **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | ------ | -------------- | ---- | ------------------------------------------------------------ | - | obj | Object或string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | -------------- | ---- | ------------------------------------------------------------ | +| obj | Object或string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。 | **返回值:** - | 类型 | 说明 | - | ----------------------------------- | --------------------------------------- | - | [FormBindingData](#formbindingdata) | 根据传入数据创建的FormBindingData对象。 | +| 类型 | 说明 | +| ----------------------------------- | --------------------------------------- | +| [FormBindingData](#formbindingdata) | 根据传入数据创建的FormBindingData对象。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-notification.md b/zh-cn/application-dev/reference/apis/js-apis-notification.md index e721e5f4cc74b067ba10d9154c715d1d317818b3..eb5b201172c214544ead98652e6809332be7a397 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md @@ -475,7 +475,7 @@ getSlots() | 类型 | 说明 | | ----------------------------------------------------------- | ------------------------------------------------------------ | | Promise\\> | 以Promise形式返回获取此应用程序的所有通知通道的结果。 | - + **示例:** ```js @@ -1999,15 +1999,17 @@ Notification.show(options); ## NotificationSubscriber +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ------------------------------------------------------------ | ---- | --- | -------- | ---- | -------------------------- | -| onConsume?:(data: [SubscribeCallbackData](#subscribecallbackdata)) | 是 | 否 | function | 否 | 接收通知回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onCancel?:(data: [SubscribeCallbackData](#subscribecallbackdata)) | 是 | 否 | function | 否 | 删除通知回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) | 是 | 否 | function | 否 | 更新通知排序回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onConnect?:() | 是 | 否 | function | 否 | 注册订阅回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onDisconnect?:() | 是 | 否 | function | 否 | 取消订阅回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onDestroy?:() | 是 | 否 | function | 否 | 服务失联回调函数。
**系统能力**:SystemCapability.Notification.Notification | -| onDoNotDisturbDateChange?:(mode: Notification.[DoNotDisturbDate](#donotdisturbdate)) | 是 | 否 | function | 否 | 免打扰时间选项变更回调函数。
**系统能力**:SystemCapability.Notification.Notification | +| onConsume?:(data: [SubscribeCallbackData](#subscribecallbackdata)) | 是 | 否 | function | 否 | 接收通知回调函数。 | +| onCancel?:(data: [SubscribeCallbackData](#subscribecallbackdata)) | 是 | 否 | function | 否 | 删除通知回调函数。 | +| onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) | 是 | 否 | function | 否 | 更新通知排序回调函数。 | +| onConnect?:() | 是 | 否 | function | 否 | 注册订阅回调函数。 | +| onDisconnect?:() | 是 | 否 | function | 否 | 取消订阅回调函数。 | +| onDestroy?:() | 是 | 否 | function | 否 | 服务失联回调函数。 | +| onDoNotDisturbDateChange?:(mode: Notification.[DoNotDisturbDate](#donotdisturbdate)) | 是 | 否 | function | 否 | 免打扰时间选项变更回调函数。 | ### onEnabledNotificationChanged @@ -2055,248 +2057,285 @@ Notification.subscribe(subscriber, subscribeCallback); ## SubscribeCallbackData +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | --------------- | ---- | --- | ------------------------------------------------- | ---- | -------- | -| request | 是 | 否 | [NotificationRequest](#notificationrequest) | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| sortingMap | 是 | 否 | [NotificationSortingMap](#notificationsortingmap) | 否 | 排序信息。
**系统能力**:SystemCapability.Notification.Notification | -| reason | 是 | 否 | number | 否 | 删除原因。
**系统能力**:SystemCapability.Notification.Notification | -| sound | 是 | 否 | string | 否 | 通知声音。
**系统能力**:SystemCapability.Notification.Notification | -| vibrationValues | 是 | 否 | Array\ | 否 | 通知震动。
**系统能力**:SystemCapability.Notification.Notification | - -。
**系统能力**:SystemCapability.Notification.Notification +| request | 是 | 否 | [NotificationRequest](#notificationrequest) | 是 | 通知内容。 | +| sortingMap | 是 | 否 | [NotificationSortingMap](#notificationsortingmap) | 否 | 排序信息。 | +| reason | 是 | 否 | number | 否 | 删除原因。 | +| sound | 是 | 否 | string | 否 | 通知声音。 | +| vibrationValues | 是 | 否 | Array\ | 否 | 通知震动。 | ## NotificationSortingMap +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------- | ---- | --- | ------------------------------------------------------------ | ---- | ---------------- | -| sortings | 是 | 否 | {[key: string]: [NotificationSorting](#notificationsorting)} | 是 | 通知排序信息数组。
**系统能力**:SystemCapability.Notification.Notification | -| sortedHashCode | 是 | 否 | Array\ | 是 | 通知唯一标识数组。
**系统能力**:SystemCapability.Notification.Notification | +| sortings | 是 | 否 | {[key: string]: [NotificationSorting](#notificationsorting)} | 是 | 通知排序信息数组。 | +| sortedHashCode | 是 | 否 | Array\ | 是 | 通知唯一标识数组。 | ## NotificationSorting +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------- | ---- | --- | ------------------------------------- | ---- | ------------ | -| slot | 是 | 否 | [NotificationSlot](#notificationslot) | 是 | 通知通道内容。
**系统能力**:SystemCapability.Notification.Notification | -| hashCode | 是 | 否 | string | 是 | 通知唯一标识。
**系统能力**:SystemCapability.Notification.Notification | -| ranking | 是 | 否 | number | 是 | 通知排序序号。
**系统能力**:SystemCapability.Notification.Notification | +| slot | 是 | 否 | [NotificationSlot](#notificationslot) | 是 | 通知通道内容。 | +| hashCode | 是 | 否 | string | 是 | 通知唯一标识。 | +| ranking | 是 | 否 | number | 是 | 通知排序序号。 | ## DoNotDisturbDate +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 描述 | | ----- | ---- | --- | ------------------------------------- | ------------------------ | -| type | 是 | 否 | [DoNotDisturbType](#donotdisturbtype) | 指定免打扰设置的时间类型。
**系统能力**:SystemCapability.Notification.Notification | -| begin | 是 | 否 | Date | 指定免打扰设置的起点时间。
**系统能力**:SystemCapability.Notification.Notification | -| end | 是 | 否 | Date | 指定免打扰设置的终点时间。
**系统能力**:SystemCapability.Notification.Notification | +| type | 是 | 否 | [DoNotDisturbType](#donotdisturbtype) | 指定免打扰设置的时间类型。 | +| begin | 是 | 否 | Date | 指定免打扰设置的起点时间。 | +| end | 是 | 否 | Date | 指定免打扰设置的终点时间。 | ## DoNotDisturbType +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + -| 名称 | 值 | 说明 | -| ------------ | ---------------- | ---------------------------------------- | -| TYPE_NONE | DoNotDisturbType | 非通知勿扰类型。
**系统能力**:SystemCapability.Notification.Notification | -| TYPE_ONCE | DoNotDisturbType | 以设置时间段(只看小时和分钟)一次执行勿扰。
**系统能力**:SystemCapability.Notification.Notification | -| TYPE_DAILY | DoNotDisturbType | 以设置时间段(只看小时和分钟)每天执行勿扰。
**系统能力**:SystemCapability.Notification.Notification | -| TYPE_CLEARLY | DoNotDisturbType | 以设置时间段(明确年月日时分)执行勿扰。
**系统能力**:SystemCapability.Notification.Notification | +| 名称 | 值 | 说明 | +| ------------ | ---------------- | ------------------------------------------ | +| TYPE_NONE | DoNotDisturbType | 非通知勿扰类型。 | +| TYPE_ONCE | DoNotDisturbType | 以设置时间段(只看小时和分钟)一次执行勿扰。 | +| TYPE_DAILY | DoNotDisturbType | 以设置时间段(只看小时和分钟)每天执行勿扰。 | +| TYPE_CLEARLY | DoNotDisturbType | 以设置时间段(明确年月日时分)执行勿扰。 | ## EnabledNotificationCallbackData +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ------ | ---- | --- | ------- | ---- | ---------------- | -| bundle | 是 | 否 | string | 否 | 应用的包名。
**系统能力**:SystemCapability.Notification.Notification | -| uid | 是 | 否 | number | 否 | 应用的uid。
**系统能力**:SystemCapability.Notification.Notification | -| enable | 是 | 否 | boolean | 否 | 应用通知使能状态。
**系统能力**:SystemCapability.Notification.Notification | +| bundle | 是 | 否 | string | 否 | 应用的包名。 | +| uid | 是 | 否 | number | 否 | 应用的uid。 | +| enable | 是 | 否 | boolean | 否 | 应用通知使能状态。 | ## NotificationRequest +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | --------------------- | ---- | --- | --------------------------------------------- | ---- | -------------------------- | -| content | 是 | 是 | [NotificationContent](#notificationcontent) | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| id | 是 | 是 | number | 否 | 通知ID。
**系统能力**:SystemCapability.Notification.Notification | -| slotType | 是 | 是 | [SlotType](#slottype) | 否 | 通道类型。
**系统能力**:SystemCapability.Notification.Notification | -| isOngoing | 是 | 是 | boolean | 否 | 是否进行时通知。
**系统能力**:SystemCapability.Notification.Notification | -| isUnremovable | 是 | 是 | boolean | 否 | 是否可移除。
**系统能力**:SystemCapability.Notification.Notification | -| deliveryTime | 是 | 是 | number | 否 | 通知发送时间。
**系统能力**:SystemCapability.Notification.Notification | -| tapDismissed | 是 | 是 | boolean | 否 | 通知是否自动清除。
**系统能力**:SystemCapability.Notification.Notification | -| autoDeletedTime | 是 | 是 | number | 否 | 自动清除的时间。
**系统能力**:SystemCapability.Notification.Notification | -| wantAgent | 是 | 是 | WantAgent | 否 | 点击跳转的WantAgent。
**系统能力**:SystemCapability.Notification.Notification | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 扩展参数。
**系统能力**:SystemCapability.Notification.Notification | -| color | 是 | 是 | number | 否 | 通知背景颜色。
**系统能力**:SystemCapability.Notification.Notification | -| colorEnabled | 是 | 是 | boolean | 否 | 通知背景颜色是否使能。
**系统能力**:SystemCapability.Notification.Notification | -| isAlertOnce | 是 | 是 | boolean | 否 | 设置是否仅有一次此通知警报。
**系统能力**:SystemCapability.Notification.Notification | -| isStopwatch | 是 | 是 | boolean | 否 | 是否显示已用时间。
**系统能力**:SystemCapability.Notification.Notification | -| isCountDown | 是 | 是 | boolean | 否 | 是否显示倒计时时间。
**系统能力**:SystemCapability.Notification.Notification | -| isFloatingIcon | 是 | 是 | boolean | 否 | 是否显示状态栏图标。
**系统能力**:SystemCapability.Notification.Notification | -| label | 是 | 是 | string | 否 | 通知标签。
**系统能力**:SystemCapability.Notification.Notification | -| badgeIconStyle | 是 | 是 | number | 否 | 通知角标类型。
**系统能力**:SystemCapability.Notification.Notification | -| showDeliveryTime | 是 | 是 | boolean | 否 | 是否显示分发时间。
**系统能力**:SystemCapability.Notification.Notification | -| actionButtons | 是 | 是 | Array\<[NotificationActionButton](#notificationactionbutton)\> | 否 | 通知按钮,最多两个按钮。
**系统能力**:SystemCapability.Notification.Notification | -| smallIcon | 是 | 是 | PixelMap | 否 | 通知小图标。
**系统能力**:SystemCapability.Notification.Notification | -| largeIcon | 是 | 是 | PixelMap | 否 | 通知大图标。
**系统能力**:SystemCapability.Notification.Notification | -| creatorBundleName | 是 | 否 | string | 否 | 创建通知的包名。
**系统能力**:SystemCapability.Notification.Notification | -| creatorUid | 是 | 否 | number | 否 | 创建通知的UID。
**系统能力**:SystemCapability.Notification.Notification | -| creatorPid | 是 | 否 | number | 否 | 创建通知的PID。
**系统能力**:SystemCapability.Notification.Notification | -| hashCode | 是 | 否 | string | 否 | 通知唯一标识。
**系统能力**:SystemCapability.Notification.Notification | -| classification | 是 | 是 | string | 否 | 通知分类。
**系统能力**:SystemCapability.Notification.Notification | -| groupName | 是 | 是 | string | 否 | 组通知名称。
**系统能力**:SystemCapability.Notification.Notification | -| template8+ | 是 | 是 | [NotificationTemplate](#notificationtemplate) | 否 | 通知模板。
**系统能力**:SystemCapability.Notification.Notification | +| content | 是 | 是 | [NotificationContent](#notificationcontent) | 是 | 通知内容。 | +| id | 是 | 是 | number | 否 | 通知ID。 | +| slotType | 是 | 是 | [SlotType](#slottype) | 否 | 通道类型。 | +| isOngoing | 是 | 是 | boolean | 否 | 是否进行时通知。 | +| isUnremovable | 是 | 是 | boolean | 否 | 是否可移除。 | +| deliveryTime | 是 | 是 | number | 否 | 通知发送时间。 | +| tapDismissed | 是 | 是 | boolean | 否 | 通知是否自动清除。 | +| autoDeletedTime | 是 | 是 | number | 否 | 自动清除的时间。 | +| wantAgent | 是 | 是 | WantAgent | 否 | 点击跳转的WantAgent。 | +| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 扩展参数。 | +| color | 是 | 是 | number | 否 | 通知背景颜色。 | +| colorEnabled | 是 | 是 | boolean | 否 | 通知背景颜色是否使能。 | +| isAlertOnce | 是 | 是 | boolean | 否 | 设置是否仅有一次此通知警报。 | +| isStopwatch | 是 | 是 | boolean | 否 | 是否显示已用时间。 | +| isCountDown | 是 | 是 | boolean | 否 | 是否显示倒计时时间。 | +| isFloatingIcon | 是 | 是 | boolean | 否 | 是否显示状态栏图标。 | +| label | 是 | 是 | string | 否 | 通知标签。 | +| badgeIconStyle | 是 | 是 | number | 否 | 通知角标类型。 | +| showDeliveryTime | 是 | 是 | boolean | 否 | 是否显示分发时间。 | +| actionButtons | 是 | 是 | Array\<[NotificationActionButton](#notificationactionbutton)\> | 否 | 通知按钮,最多两个按钮。 | +| smallIcon | 是 | 是 | PixelMap | 否 | 通知小图标。 | +| largeIcon | 是 | 是 | PixelMap | 否 | 通知大图标。 | +| creatorBundleName | 是 | 否 | string | 否 | 创建通知的包名。 | +| creatorUid | 是 | 否 | number | 否 | 创建通知的UID。 | +| creatorPid | 是 | 否 | number | 否 | 创建通知的PID。 | +| hashCode | 是 | 否 | string | 否 | 通知唯一标识。 | +| classification | 是 | 是 | string | 否 | 通知分类。 | +| groupName | 是 | 是 | string | 否 | 组通知名称。 | +| template8+ | 是 | 是 | [NotificationTemplate](#notificationtemplate) | 否 | 通知模板。 | ## NotificationSlot +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------------- | ---- | --- | --------------------- | ---- | ------------------------------------------ | -| type | 是 | 是 | [SlotType](#slottype) | 是 | 通道类型。
**系统能力**:SystemCapability.Notification.Notification | -| level | 是 | 是 | number | 否 | 通知级别,不设置则根据通知渠道类型有默认值。
**系统能力**:SystemCapability.Notification.Notification | -| desc | 是 | 是 | string | 否 | 通知渠道描述信息。
**系统能力**:SystemCapability.Notification.Notification | -| badgeFlag | 是 | 是 | boolean | 否 | 是否显示角标。
**系统能力**:SystemCapability.Notification.Notification | -| bypassDnd | 是 | 是 | boolean | 否 | 置是否在系统中绕过免打扰模式。
**系统能力**:SystemCapability.Notification.Notification | -| lockscreenVisibility | 是 | 是 | boolean | 否 | 在锁定屏幕上显示通知的模式。
**系统能力**:SystemCapability.Notification.Notification | -| vibrationEnabled | 是 | 是 | boolean | 否 | 是否可振动。
**系统能力**:SystemCapability.Notification.Notification | -| sound | 是 | 是 | string | 否 | 通知提示音。
**系统能力**:SystemCapability.Notification.Notification | -| lightEnabled | 是 | 是 | boolean | 否 | 是否闪灯。
**系统能力**:SystemCapability.Notification.Notification | -| lightColor | 是 | 是 | number | 否 | 通知灯颜色。
**系统能力**:SystemCapability.Notification.Notification | -| vibrationValues | 是 | 是 | Array\ | 否 | 通知振动样式。
**系统能力**:SystemCapability.Notification.Notification | - +| type | 是 | 是 | [SlotType](#slottype) | 是 | 通道类型。 | +| level | 是 | 是 | number | 否 | 通知级别,不设置则根据通知渠道类型有默认值。 | +| desc | 是 | 是 | string | 否 | 通知渠道描述信息。 | +| badgeFlag | 是 | 是 | boolean | 否 | 是否显示角标。 | +| bypassDnd | 是 | 是 | boolean | 否 | 置是否在系统中绕过免打扰模式。 | +| lockscreenVisibility | 是 | 是 | boolean | 否 | 在锁定屏幕上显示通知的模式。 | +| vibrationEnabled | 是 | 是 | boolean | 否 | 是否可振动。 | +| sound | 是 | 是 | string | 否 | 通知提示音。 | +| lightEnabled | 是 | 是 | boolean | 否 | 是否闪灯。 | +| lightColor | 是 | 是 | number | 否 | 通知灯颜色。 | +| vibrationValues | 是 | 是 | Array\ | 否 | 通知振动样式。 | ## NotificationContent +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ----------- | ---- | --- | ------------------------------------------------------------ | ---- | ------------------ | -| contentType | 是 | 是 | [ContentType](#contenttype) | 是 | 通知内容类型。
**系统能力**:SystemCapability.Notification.Notification | -| normal | 是 | 是 | [NotificationBasicContent](#notificationbasiccontent) | 否 | 基本类型通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| longText | 是 | 是 | [NotificationLongTextContent](#notificationlongtextcontent) | 否 | 长文本类型通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| multiLine | 是 | 是 | [NotificationMultiLineContent](#notificationmultilinecontent) | 否 | 多行类型通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| picture | 是 | 是 | [NotificationPictureContent](#notificationpicturecontent) | 否 | 图片类型通知内容。
**系统能力**:SystemCapability.Notification.Notification | +| contentType | 是 | 是 | [ContentType](#contenttype) | 是 | 通知内容类型。 | +| normal | 是 | 是 | [NotificationBasicContent](#notificationbasiccontent) | 否 | 基本类型通知内容。 | +| longText | 是 | 是 | [NotificationLongTextContent](#notificationlongtextcontent) | 否 | 长文本类型通知内容。 | +| multiLine | 是 | 是 | [NotificationMultiLineContent](#notificationmultilinecontent) | 否 | 多行类型通知内容。 | +| picture | 是 | 是 | [NotificationPictureContent](#notificationpicturecontent) | 否 | 图片类型通知内容。 | ## ContentType -| 名称 | 值 | 说明 | -| --------------------------------- | ----------- | ---------------- | -| NOTIFICATION_CONTENT_BASIC_TEXT | ContentType | 普通类型通知。
**系统能力**:SystemCapability.Notification.Notification | -| NOTIFICATION_CONTENT_LONG_TEXT | ContentType | 长文本类型通知。
**系统能力**:SystemCapability.Notification.Notification | -| NOTIFICATION_CONTENT_PICTURE | ContentType | 图片类型通知。
**系统能力**:SystemCapability.Notification.Notification | -| NOTIFICATION_CONTENT_CONVERSATION | ContentType | 社交类型通知。
**系统能力**:SystemCapability.Notification.Notification | -| NOTIFICATION_CONTENT_MULTILINE | ContentType | 多行文本类型通知。
**系统能力**:SystemCapability.Notification.Notification | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 值 | 说明 | +| --------------------------------- | ----------- | ------------------ | +| NOTIFICATION_CONTENT_BASIC_TEXT | ContentType | 普通类型通知。 | +| NOTIFICATION_CONTENT_LONG_TEXT | ContentType | 长文本类型通知。 | +| NOTIFICATION_CONTENT_PICTURE | ContentType | 图片类型通知。 | +| NOTIFICATION_CONTENT_CONVERSATION | ContentType | 社交类型通知。 | +| NOTIFICATION_CONTENT_MULTILINE | ContentType | 多行文本类型通知。 | ## NotificationBasicContent -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------------- | ---- |--- | ------ | ---- | -------------------------------- | -| title | 是 | 是 | string | 是 | 通知标题。
**系统能力**:SystemCapability.Notification.Notification | -| text | 是 | 是 | string | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。
**系统能力**:SystemCapability.Notification.Notification | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | +| -------------- | ---- | ---- | ------ | ---- | ---------------------------------- | +| title | 是 | 是 | string | 是 | 通知标题。 | +| text | 是 | 是 | string | 是 | 通知内容。 | +| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。 | ## NotificationLongTextContent +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------- | ---- | --- | ------ | ---- | -------------------------------- | -| title | 是 | 是 | string | 是 | 通知标题。
**系统能力**:SystemCapability.Notification.Notification | -| text | 是 | 是 | string | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。
**系统能力**:SystemCapability.Notification.Notification | -| longText | 是 | 是 | string | 是 | 通知的长文本。
**系统能力**:SystemCapability.Notification.Notification | -| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。
**系统能力**:SystemCapability.Notification.Notification | -| expandedTitle | 是 | 是 | string | 是 | 通知展开时的标题。
**系统能力**:SystemCapability.Notification.Notification | +| title | 是 | 是 | string | 是 | 通知标题。 | +| text | 是 | 是 | string | 是 | 通知内容。 | +| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。 | +| longText | 是 | 是 | string | 是 | 通知的长文本。 | +| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。 | +| expandedTitle | 是 | 是 | string | 是 | 通知展开时的标题。 | ## NotificationMultiLineContent +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------- | --- | --- | --------------- | ---- | -------------------------------- | -| title | 是 | 是 | string | 是 | 通知标题。
**系统能力**:SystemCapability.Notification.Notification | -| text | 是 | 是 | string | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。
**系统能力**:SystemCapability.Notification.Notification | -| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。
**系统能力**:SystemCapability.Notification.Notification | -| longTitle | 是 | 是 | string | 是 | 通知展开时的标题。
**系统能力**:SystemCapability.Notification.Notification | -| lines | 是 | 是 | Array\ | 是 | 通知的多行文本。
**系统能力**:SystemCapability.Notification.Notification | +| title | 是 | 是 | string | 是 | 通知标题。 | +| text | 是 | 是 | string | 是 | 通知内容。 | +| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。 | +| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。 | +| longTitle | 是 | 是 | string | 是 | 通知展开时的标题。 | +| lines | 是 | 是 | Array\ | 是 | 通知的多行文本。 | ## NotificationPictureContent +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------- | ---- | --- | -------------- | ---- | -------------------------------- | -| title | 是 | 是 | string | 是 | 通知标题。
**系统能力**:SystemCapability.Notification.Notification | -| text | 是 | 是 | string | 是 | 通知内容。
**系统能力**:SystemCapability.Notification.Notification | -| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。
**系统能力**:SystemCapability.Notification.Notification | -| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。
**系统能力**:SystemCapability.Notification.Notification | -| expandedTitle | 是 | 是 | string | 是 | 通知展开时的标题。
**系统能力**:SystemCapability.Notification.Notification | -| picture | 是 | 是 | image.PixelMap | 是 | 通知的图片内容。
**系统能力**:SystemCapability.Notification.Notification | +| title | 是 | 是 | string | 是 | 通知标题。 | +| text | 是 | 是 | string | 是 | 通知内容。 | +| additionalText | 是 | 是 | string | 是 | 通知次要内容,是对通知内容的补充。 | +| briefText | 是 | 是 | string | 是 | 通知概要内容,是对通知内容的总结。 | +| expandedTitle | 是 | 是 | string | 是 | 通知展开时的标题。 | +| picture | 是 | 是 | image.PixelMap | 是 | 通知的图片内容。 | ## BundleOption +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ------ | ---- | --- | ------ | ---- | ------ | -| bundle | 是 | 是 | string | 是 | 包名。
**系统能力**:SystemCapability.Notification.Notification | -| uid | 是 | 是 | number | 否 | 用户id。
**系统能力**:SystemCapability.Notification.Notification | +| bundle | 是 | 是 | string | 是 | 包名。 | +| uid | 是 | 是 | number | 否 | 用户id。 | ## NotificationKey +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ----- | ---- | --- | ------ | ---- | -------- | -| id | 是 | 是 | number | 是 | 通知ID。
**系统能力**:SystemCapability.Notification.Notification | -| label | 是 | 是 | string | 否 | 通知标签。
**系统能力**:SystemCapability.Notification.Notification | +| id | 是 | 是 | number | 是 | 通知ID。 | +| label | 是 | 是 | string | 否 | 通知标签。< | ## SlotType -| 名称 | 值 | 说明 | -| -------------------- | -------- | -------- | -| SOCIAL_COMMUNICATION | SlotType | 社交类型。
**系统能力**:SystemCapability.Notification.Notification | -| SERVICE_INFORMATION | SlotType | 服务类型。
**系统能力**:SystemCapability.Notification.Notification | -| CONTENT_INFORMATION | SlotType | 内容类型。
**系统能力**:SystemCapability.Notification.Notification | -| OTHER_TYPES | SlotType | 其他类型。
**系统能力**:SystemCapability.Notification.Notification | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 值 | 说明 | +| -------------------- | -------- | ---------- | +| SOCIAL_COMMUNICATION | SlotType | 社交类型。 | +| SERVICE_INFORMATION | SlotType | 服务类型。 | +| CONTENT_INFORMATION | SlotType | 内容类型。 | +| OTHER_TYPES | SlotType | 其他类型。 | ## NotificationActionButton +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | --------- | --- | ---- | ----------------------------------------------- | ---- | ------------------------- | -| title | 是 | 是 | string | 是 | 按钮标题。
**系统能力**:SystemCapability.Notification.Notification | -| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。
**系统能力**:SystemCapability.Notification.Notification | -| extras | 是 | 是 | Array\ | 否 | 按钮扩展信息。
**系统能力**:SystemCapability.Notification.Notification | -| icon | 是 | 是 | image.PixelMap | 否 | 按钮图标。
**系统能力**:SystemCapability.Notification.Notification | -| userInput | 是 | 是 | [NotificationUserInput](#notificationuserinput) | 否 | 用户输入对象实例。
**系统能力**:SystemCapability.Notification.Notification | +| title | 是 | 是 | string | 是 | 按钮标题。 | +| wantAgent | 是 | 是 | WantAgent | 是 | 点击按钮时触发的WantAgent。 | +| extras | 是 | 是 | Array\ | 否 | 按钮扩展信息。 | +| icon | 是 | 是 | image.PixelMap | 否 | 按钮图标。 | +| userInput | 是 | 是 | [NotificationUserInput](#notificationuserinput) | 否 | 用户输入对象实例。 | ## NotificationUserInput +**系统能力:**SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------- | --- | ---- | ------ | ---- | ----------------------------- | -| inputKey | 是 | 是 | string | 是 | 用户输入时用于标识此输入的key。
**系统能力**:SystemCapability.Notification.Notification | +| inputKey | 是 | 是 | string | 是 | 用户输入时用于标识此输入的key。 | ## NotificationSubscribeInfo +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ----------- | --- | ---- | --------------- | ---- | ------------------------------- | -| bundleNames | 是 | 是 | Array\ | 否 | 指定订阅哪些包名的APP发来的通知。
**系统能力**:SystemCapability.Notification.Notification | -| userId | 是 | 是 | number | 否 | 指定订阅哪个用户下发来的通知。
**系统能力**:SystemCapability.Notification.Notification | +| bundleNames | 是 | 是 | Array\ | 否 | 指定订阅哪些包名的APP发来的通知。 | +| userId | 是 | 是 | number | 否 | 指定订阅哪个用户下发来的通知。 | @@ -2304,30 +2343,36 @@ Notification.subscribe(subscriber, subscribeCallback); 模板信息 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| ---- | ---------------------- | ---- | ---- | -------- | -| name | string | 是 | 是 | 模板名称。
**系统能力**:SystemCapability.Notification.Notification | -| data | {[key:string]: Object} | 是 | 是 | 模板数据。
**系统能力**:SystemCapability.Notification.Notification | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ---- | ---------------------- | ---- | ---- | ---------- | +| name | string | 是 | 是 | 模板名称。 | +| data | {[key:string]: Object} | 是 | 是 | 模板数据。 | ## ActionResult +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ------------ | ---------- | ---- | ---- | -------- | -| bundleName | string | 是 | 是 | 点击通知后重定向应用的包名。
**系统能力**:SystemCapability.Notification.Notification | -| abilityName | string | 是 | 是 | 点击通知后重定向应用的的Ability名称。
**系统能力**:SystemCapability.Notification.Notification | -| uri | string | 是 | 是 | 要重定向到的页面的Uri。
**系统能力**:SystemCapability.Notification.Notification | +| bundleName | string | 是 | 是 | 点击通知后重定向应用的包名。 | +| abilityName | string | 是 | 是 | 点击通知后重定向应用的的Ability名称。 | +| uri | string | 是 | 是 | 要重定向到的页面的Uri。 | ## ShowNotificationOptions +**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.Notification + | 名称 | 参数类型 | 可读 | 可写 | 说明 | | ------------ | ---------- | ---- | ---- | -------- | -| contentTitle | string | 是 | 是 | 通知的标题。
**系统能力**:SystemCapability.Notification.Notification | -| contentText | string | 是 | 是 | 通知的内容。
**系统能力**:SystemCapability.Notification.Notification | -| clickAction | ActionResult | 是 | 是 | 点击通知后触发的动作。
**系统能力**:SystemCapability.Notification.Notification | +| contentTitle | string | 是 | 是 | 通知的标题。 | +| contentText | string | 是 | 是 | 通知的内容。 | +| clickAction | ActionResult | 是 | 是 | 点击通知后触发的动作。 | @@ -3244,45 +3289,53 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => { ## WantAgentInfo +**系统能力:**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | -------------- | --- | ---- | ------------------------------- | ---- | ---------------------- | -| wants | 是 | 是 | Array\ | 是 | 将被执行的动作列表。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| operationType | 是 | 是 | wantAgent.OperationType | 是 | 动作类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| requestCode | 是 | 是 | number | 是 | 使用者定义的一个私有值。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| wantAgentFlags | 是 | 是 | Array | 否 | 动作执行属性。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | +| wants | 是 | 是 | Array\ | 是 | 将被执行的动作列表。 | +| operationType | 是 | 是 | wantAgent.OperationType | 是 | 动作类型。 | +| requestCode | 是 | 是 | number | 是 | 使用者定义的一个私有值。 | +| wantAgentFlags | 是 | 是 | Array | 否 | 动作执行属性。 | +| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | ## WantAgentFlags +**系统能力:**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core + | 名称 | 值 | 说明 | | ------------------- | -------------- | ------------------------------------------------------------ | -| ONE_TIME_FLAG | WantAgentFlags | WantAgent仅能使用一次。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| NO_BUILD_FLAG | WantAgentFlags | 如果描述WantAgent对象不存在,则不创建它,直接返回null。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| CANCEL_PRESENT_FLAG | WantAgentFlags | 在生成一个新的WantAgent对象前取消已存在的一个WantAgent对象。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| UPDATE_PRESENT_FLAG | WantAgentFlags | 使用新的WantAgent的额外数据替换已存在的WantAgent中的额外数据。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| CONSTANT_FLAG | WantAgentFlags | WantAgent是不可变的。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | +| ONE_TIME_FLAG | WantAgentFlags | WantAgent仅能使用一次。 | +| NO_BUILD_FLAG | WantAgentFlags | 如果描述WantAgent对象不存在,则不创建它,直接返回null。 | +| CANCEL_PRESENT_FLAG | WantAgentFlags | 在生成一个新的WantAgent对象前取消已存在的一个WantAgent对象。 | +| UPDATE_PRESENT_FLAG | WantAgentFlags | 使用新的WantAgent的额外数据替换已存在的WantAgent中的额外数据。 | +| CONSTANT_FLAG | WantAgentFlags | WantAgent是不可变的。 | ## OperationType -| 名称 | 值 | 说明 | -| ----------------- | ------------- | ----------------------- | -| UNKNOWN_TYPE | OperationType | 不识别的类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| START_ABILITY | OperationType | 开启一个有页面的Ability。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| START_ABILITIES | OperationType | 开启多个有页面的Ability。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| START_SERVICE | OperationType | 开启一个无页面的ability。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| SEND_COMMON_EVENT | OperationType | 发送一个公共事件。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | +**系统能力:**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core + +| 名称 | 值 | 说明 | +| ----------------- | ------------- | ------------------------- | +| UNKNOWN_TYPE | OperationType | 不识别的类型。 | +| START_ABILITY | OperationType | 开启一个有页面的Ability。 | +| START_ABILITIES | OperationType | 开启多个有页面的Ability。 | +| START_SERVICE | OperationType | 开启一个无页面的ability。 | +| SEND_COMMON_EVENT | OperationType | 发送一个公共事件。 | ## TriggerInfo +**系统能力:**以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core + | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ---------- | --- | ---- | -------------------- | ---- | ----------- | -| code | 是 | 是 | number | 是 | result code。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| want | 是 | 是 | Want | 否 | Want。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| permission | 是 | 是 | string | 否 | 权限定义。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core | +| code | 是 | 是 | number | 是 | result code。 | +| want | 是 | 是 | Want | 否 | Want。 | +| permission | 是 | 是 | string | 否 | 权限定义。 | +| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md index 5d634d453ea544c2eff9e67b164e41d6e4de6a1d..67843e60cb15ae08347b45596679ba56fc5dda30 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -11,11 +11,6 @@ import reminderAgent from'@ohos.reminderAgent'; ``` -## 系统能力 - -SystemCapability.Notification.ReminderAgent - - ## 权限 ohos.permission.PUBLISH_AGENT_REMINDER @@ -27,11 +22,15 @@ publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number& 发布一个后台代理提醒,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 - | 参数名 | 类型 | 必填 | 说明 | + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 | - | callback | AsyncCallback<number> | 是 | 异步回调,返回当前发布的提醒的reminderId。 | + | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 | + | callback | AsyncCallback<number> | 是 | 异步回调,返回当前发布的提醒的reminderId。 | - 示例: ``` @@ -54,15 +53,19 @@ publishReminder(reminderReq: ReminderRequest): Promise<number> 发布一个后台代理提醒,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 - | 参数名 | 类型 | 必填 | 说明 | + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 | + | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 | - 返回值: - | 类型 | 说明 | + | 类型 | 说明 | | -------- | -------- | - | Promise<number> | 返回提醒的reminderId。 | + | Promise<number> | 返回提醒的reminderId。 | - 示例 ``` @@ -86,12 +89,16 @@ cancelReminder(reminderId: number, callback: AsyncCallback<void>): void 取消指定id的提醒,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| reminderId | number | 是 | 目标reminder的id号。 | -| callback | AsyncCallback<void> | 是 | 异步回调。 | +| reminderId | number | 是 | 目标reminder的id号。 | +| callback | AsyncCallback<void> | 是 | 异步回调。 | - 示例 @@ -111,17 +118,21 @@ cancelReminder(reminderId: number): Promise<void> 取消指定id的提醒,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| reminderId | number | 是 | 目标reminder的id号。 | +| reminderId | number | 是 | 目标reminder的id号。 | - 返回值 -| 类型 | 说明 | +| 类型 | 说明 | | -------- | -------- | -| Promise<void> | Promise类型异步回调。 | +| Promise<void> | Promise类型异步回调。 | - 示例 @@ -142,11 +153,15 @@ getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): 获取当前应用已设置的所有有效(未过期)的提醒,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback<Array<[ReminderRequest](#reminderrequest)>> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 | +| callback | AsyncCallback<Array<[ReminderRequest](#reminderrequest)>> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 | - 示例 @@ -183,11 +198,15 @@ getValidReminders(): Promise<Array<ReminderRequest>> 获取当前应用已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 返回值 -| 类型 | 说明 | +| 类型 | 说明 | | -------- | -------- | -| Promise<Array<[ReminderRequest](#reminderrequest)>> | 返回当前应用已设置的所有有效(未过期)的提醒。 | +| Promise<Array<[ReminderRequest](#reminderrequest)>> | 返回当前应用已设置的所有有效(未过期)的提醒。 | - 示例 @@ -224,11 +243,15 @@ cancelAllReminders(callback: AsyncCallback<void>): void 取消当前应用所有的提醒,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback<void> | 是 | 异步回调。 | +| callback | AsyncCallback<void> | 是 | 异步回调。 | - 示例 @@ -244,11 +267,15 @@ cancelAllReminders(): Promise<void> 取消当前应用所有的提醒,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 返回值 -| 类型 | 说明 | +| 类型 | 说明 | | -------- | -------- | -| Promise<void> | Promise类型异步回调。 | +| Promise<void> | Promise类型异步回调。 | - 示例 @@ -264,12 +291,16 @@ addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>) 添加一个NotificationSlot,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slot | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref1954171018915,link:zh-cn_topic_0000001180018813.xml#section1382174172015](zh-cn_topic_0000001180018813.xml#section1382174172015) | 是 | notification slot实例。 | -| callback | AsyncCallback<void> | 是 | 异步回调。 | +| slot | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref1954171018915,link:zh-cn_topic_0000001180018813.xml#section1382174172015](zh-cn_topic_0000001180018813.xml#section1382174172015) | 是 | notification slot实例。 | +| callback | AsyncCallback<void> | 是 | 异步回调。 | - 示例 @@ -293,17 +324,21 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> 添加一个NotificationSlot,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slot | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref2049924012917,link:zh-cn_topic_0000001180018813.xml#section1382174172015](zh-cn_topic_0000001180018813.xml#section1382174172015) | 是 | notification slot实例。 | +| slot | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref2049924012917,link:zh-cn_topic_0000001180018813.xml#section1382174172015](zh-cn_topic_0000001180018813.xml#section1382174172015) | 是 | notification slot实例。 | - 返回值 -| 类型 | 说明 | +| 类型 | 说明 | | -------- | -------- | -| Promise<void> | Promise类型异步回调。 | +| Promise<void> | Promise类型异步回调。 | - 示例 @@ -327,12 +362,16 @@ removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback& 删除目标NotificationSlot,使用callback方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref11228182975217,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 是 | 目标notification slot的类型。 | -| callback | AsyncCallback<void> | 是 | 异步回调。 | +| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref11228182975217,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 是 | 目标notification slot的类型。 | +| callback | AsyncCallback<void> | 是 | 异步回调。 | - 示例 @@ -352,17 +391,21 @@ removeNotificationSlot(slotType: notification.SlotType): Promise<void> 删除目标NotificationSlot,使用Promise方式实现异步调用。 +- 系统能力 + + SystemCapability.Notification.ReminderAgent + - 参数 -| 参数名 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref1120863519109,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 是 | 目标notification slot的类型。 | +| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref1120863519109,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 是 | 目标notification slot的类型。 | - 返回值 -| 类型 | 说明 | +| 类型 | 说明 | | -------- | -------- | -| Promise<void> | Promise类型异步回调。 | +| Promise<void> | Promise类型异步回调。 | - 示例 @@ -380,72 +423,84 @@ export default { 按钮的类型。 -| 名称 | 默认值 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 默认值 | 说明 | | -------- | -------- | -------- | -| ACTION_BUTTON_TYPE_CLOSE | 0 | 表示关闭提醒的按钮。 | -| ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延迟提醒的按钮。 | +| ACTION_BUTTON_TYPE_CLOSE | 0 | 表示关闭提醒的按钮。 | +| ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延迟提醒的按钮。 | ## ReminderType 提醒的类型。 -| 名称 | 默认值 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 默认值 | 说明 | | -------- | -------- | -------- | -| REMINDER_TYPE_TIMER | 0 | 表示提醒类型:倒计时。 | -| REMINDER_TYPE_CALENDAR | 1 | 表示提醒类型:日历。 | -| REMINDER_TYPE_ALARM | 2 | 表示提醒类型:闹钟。 | +| REMINDER_TYPE_TIMER | 0 | 表示提醒类型:倒计时。 | +| REMINDER_TYPE_CALENDAR | 1 | 表示提醒类型:日历。 | +| REMINDER_TYPE_ALARM | 2 | 表示提醒类型:闹钟。 | ## ActionButton 用于设置弹出的提醒通知信息上显示的按钮类型和标题。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| title | string | 是 | 按钮显示的标题。 | -| type | [ActionButtonType](#actionbuttontype) | 是 | 按钮的类型。 | +| title | string | 是 | 按钮显示的标题。 | +| type | [ActionButtonType](#actionbuttontype) | 是 | 按钮的类型。 | ## WantAgent 点击提醒通知后跳转的目标ability信息。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| pkgName | string | 是 | 指明点击提醒通知栏后跳转的目标hap包名。 | -| abilityName | string | 是 | 指明点击提醒通知栏后跳转的目标ability名称。 | +| pkgName | string | 是 | 指明点击提醒通知栏后跳转的目标hap包名。 | +| abilityName | string | 是 | 指明点击提醒通知栏后跳转的目标ability名称。 | ## MaxScreenWantAgent 提醒到达时自动拉起的目标ability信息。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| pkgName | string | 是 | 指明提醒到达时自动拉起的目标hap包名(如果设备在使用中,则只弹出通知横幅框)。 | -| abilityName | string | 是 | 指明提醒到达时自动拉起的目标ability名(如果设备在使用中,则只弹出通知横幅框)。 | +| pkgName | string | 是 | 指明提醒到达时自动拉起的目标hap包名(如果设备在使用中,则只弹出通知横幅框)。 | +| abilityName | string | 是 | 指明提醒到达时自动拉起的目标ability名(如果设备在使用中,则只弹出通知横幅框)。 | ## ReminderRequest 提醒实例对象,用于设置提醒类型、响铃时长等具体信息。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| reminderType | ReminderType | 是 | 指明提醒类型。 | -| actionButton | [ActionButton?, ActionButton?] | 否 | 弹出的提醒通知栏中显示的按钮(参数可选,支持0/1/2个按钮)。 | -| wantAgent | WantAgent | 否 | 点击通知后需要跳转的目标ability信息。 | -| maxScreenWantAgent | MaxScreenWantAgent | 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 | -| ringDuration | number | 否 | 指明响铃时长。 | -| snoozeTimes | number | 否 | 指明延迟提醒次数。 | -| timeInterval | number | 否 | 执行延迟提醒间隔。 | -| title | string | 否 | 指明提醒标题。 | -| content | string | 否 | 指明提醒内容。 | -| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 | -| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 | -| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 | -| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref39047351518,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 否 | 指明提醒的slot类型。 | +| reminderType | ReminderType | 是 | 指明提醒类型。 | +| actionButton | [ActionButton?, ActionButton?] | 否 | 弹出的提醒通知栏中显示的按钮(参数可选,支持0/1/2个按钮)。 | +| wantAgent | WantAgent | 否 | 点击通知后需要跳转的目标ability信息。 | +| maxScreenWantAgent | MaxScreenWantAgent | 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 | +| ringDuration | number | 否 | 指明响铃时长。 | +| snoozeTimes | number | 否 | 指明延迟提醒次数。 | +| timeInterval | number | 否 | 执行延迟提醒间隔。 | +| title | string | 否 | 指明提醒标题。 | +| content | string | 否 | 指明提醒内容。 | +| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 | +| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 | +| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 | +| slotType | [ERROR:Invalid link:zh-cn_topic_0000001158696346.xml#xref39047351518,link:zh-cn_topic_0000001180018813.xml#section072355105110](zh-cn_topic_0000001180018813.xml#section072355105110) | 否 | 指明提醒的slot类型。 | ## ReminderRequestCalendar @@ -454,11 +509,13 @@ ReminderRequestCalendar extends ReminderRequest 日历实例对象,用于设置提醒的时间。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| dateTime | [LocalDateTime](#localdatetime) | 是 | 指明提醒的目标时间。 | -| repeatMonths | Array<number> | 否 | 指明重复提醒的月份。 | -| repeatDays | Array<number> | 否 | 指明重复提醒的日期。 | +| dateTime | [LocalDateTime](#localdatetime) | 是 | 指明提醒的目标时间。 | +| repeatMonths | Array<number> | 否 | 指明重复提醒的月份。 | +| repeatDays | Array<number> | 否 | 指明重复提醒的日期。 | ## ReminderRequestAlarm @@ -467,11 +524,13 @@ ReminderRequestAlarm extends ReminderRequest 闹钟实例对象,用于设置提醒的时间。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| hour | number | 是 | 指明提醒的目标时刻。 | -| minute | number | 是 | 指明提醒的目标分钟。 | -| daysOfWeek | Array<number> | 否 | 指明每周哪几天需要重复提醒。 | +| hour | number | 是 | 指明提醒的目标时刻。 | +| minute | number | 是 | 指明提醒的目标分钟。 | +| daysOfWeek | Array<number> | 否 | 指明每周哪几天需要重复提醒。 | ## ReminderRequestTimer @@ -480,20 +539,24 @@ ReminderRequestTimer extends ReminderRequest 倒计时实例对象,用于设置提醒的时间。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| triggerTimeInSeconds | number | 是 | 指明倒计时的秒数。 | +| triggerTimeInSeconds | number | 是 | 指明倒计时的秒数。 | ## LocalDateTime 用于日历类提醒设置时指定时间信息。 -| 名称 | 参数类型 | 必填 | 说明 | +- 系统能力:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent + +| 名称 | 参数类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| year | number | 是 | 年 | -| month | number | 是 | 月 | -| day | number | 是 | 日 | -| hour | number | 是 | 时 | -| minute | number | 是 | 分 | -| second | number | 否 | 秒 | +| year | number | 是 | 年 | +| month | number | 是 | 月 | +| day | number | 是 | 日 | +| hour | number | 是 | 时 | +| minute | number | 是 | 分 | +| second | number | 否 | 秒 |