diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md index 189cc038db96416207b161bd174dd753215d04a3..bbead21038153a0d76f90f9d4ddfe8cb7a2a1b9c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md @@ -5,12 +5,12 @@ ## CommonEventData -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ---------- | -------- | -------------------- | ---- | ------------------------------------------------------- | -| event | 只读 | string | 是 | 表示当前接收的公共事件名称 | -| bundleName | 只读 | string | 否 | 表示包名称 | -| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据 | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据< | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | \ No newline at end of file +| event | 只读 | string | 是 | 表示当前接收的公共事件名称。 | +| bundleName | 只读 | string | 否 | 表示包名称。 | +| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据。 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md index 8f9a240fa4cf05cb1e65b5136a0e46b9a69d07b5..ee39ba0876019444183614f241490531217f6f6b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md @@ -5,15 +5,15 @@ ## CommonEventPublishData -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | --------------------- | -------- | -------------------- | ---- | ---------------------------- | -| bundleName | 只读 | string | 否 | 表示包名称 | -| code | 只读 | number | 否 | 表示公共事件的结果代码 | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据 | -| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限 | -| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件 | -| isSticky | 只读 | boolean | 否 | 表示是否是粘性事件 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | +| bundleName | 只读 | string | 否 | 表示包名称。 | +| code | 只读 | number | 否 | 表示公共事件的结果代码。 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据。 | +| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限。 | +| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件。 | +| isSticky | 只读 | boolean | 否 | 表示是否是粘性事件。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md index 546a275e7be103559b8369ce14d65f906c5a15ba..45fa02c374125ae5ab7b2b8ebff9f9c5cdbb2d09 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md @@ -5,12 +5,12 @@ ## CommonEventSubscribeInfo -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ------------------- | -------- | -------------- | ---- | ------------------------------------------------------------ | -| events | 只读 | Array\ | 是 | 表示要发送的公共事件 | -| publisherPermission | 只读 | string | 否 | 表示发布者的权限 | -| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID | +| events | 只读 | Array\ | 是 | 表示要发送的公共事件。 | +| publisherPermission | 只读 | string | 否 | 表示发布者的权限。 | +| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID。 | | userId | 只读 | number | 否 | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。 | -| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000 | \ No newline at end of file +| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md index f2e9d685920e39137a7e3bcf3a9bc30b9beca8f0..bd9fa5fa8d68e66047faade516617e3ac0668bfa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md @@ -17,7 +17,7 @@ getCode(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | ---------------------- | ---- | ------------------ | -| callback | AsyncCallback\ | 是 | 公共事件的结果代码 | +| callback | AsyncCallback\ | 是 | 公共事件的结果代码。 | **示例:** @@ -104,7 +104,7 @@ setCode(code: number): Promise\ | 参数名 | 类型 | 必填 | 描述 | | ------ | ------ | ---- | ------------------ | -| code | number | 是 | 公共事件的结果代码 | +| code | number | 是 | 公共事件的结果代码。 | **示例:** @@ -160,7 +160,7 @@ getData(): Promise\ | 类型 | 说明 | | ---------------- | ------------------ | -| Promise\ | 公共事件的结果数据 | +| Promise\ | 公共事件的结果数据。 | **示例:** @@ -186,8 +186,8 @@ setData(data: string, callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | -------------------- | ---- | -------------------- | -| data | string | 是 | 公共事件的结果数据 | -| callback | AsyncCallback\ | 是 | 表示被指定的回调方法 | +| data | string | 是 | 公共事件的结果数据。 | +| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 | **示例:** @@ -472,7 +472,7 @@ clearAbortCommonEvent(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | -------------------- | ---- | -------------------- | -| callback | AsyncCallback\ | 是 | 表示被指定的回调方法 | +| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 | **示例:** @@ -522,7 +522,7 @@ getAbortCommonEvent(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | ----------------------- | ---- | ---------------------------------- | -| callback | AsyncCallback\ | 是 | 表示当前有序公共事件是否取消的状态 | +| callback | AsyncCallback\ | 是 | 表示当前有序公共事件是否取消的状态。 | **示例:** @@ -552,7 +552,7 @@ getAbortCommonEvent(): Promise\ | 类型 | 说明 | | ----------------- | ---------------------------------- | -| Promise\ | 表示当前有序公共事件是否取消的状态 | +| Promise\ | 表示当前有序公共事件是否取消的状态。 | **示例:** 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 220b08370f7f8076732e6d49d4ea438d43fcad38..8f8b24a06499afe935dbdb6e9161e52ff9f93942 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md @@ -186,7 +186,7 @@ Notification.cancel(0, "label", cancelCallback) ## Notification.cancel -cancel(id:number, label? :string): Promise\ +cancel(id:number, label?:string): Promise\ 取消与指定id相匹配的已发布通知,label可以指定也可以不指定(Promise形式)。 @@ -2562,7 +2562,7 @@ Notification.getDeviceRemindType() | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ----- | ---- | --- | ------ | ---- | -------- | | id | 是 | 是 | number | 是 | 通知ID。 | -| label | 是 | 是 | string | 否 | 通知标签。< | +| label | 是 | 是 | string | 否 | 通知标签。 | ## SlotType diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md b/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md index 847757f753b58327aa054f220778dbffc352a1e1..5bec0139381265b8e27a6f585253d7c47c91fcc0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md @@ -13,7 +13,7 @@ | -------------- | --- | --------------------------------- | | TYPE_NONE | 0 | 默认标志。 | | TYPE_OPEN | 1 | 通知标志打开。 | -| TYPE_CLOSE | 2 | 通知标志打开。 | +| TYPE_CLOSE | 2 | 通知标志关闭。 | ## NotificationFlags diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md index 01a8ad8549a5f780c5d9d8c69eb3368b86191bc9..f92fc60d9518e7847c3cf64f81517f9d2d27e318 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md @@ -101,7 +101,7 @@ onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) | 参数名 | 类型 | 必填 | 说明 | | ------------ | ------------------------ | ---- | -------------------------- | -| data | [NotificationSortingMap](#notificationsortingmap) | 是 | | +| data | [NotificationSortingMap](#notificationsortingmap) | 是 | 回调返回接收到的通知信息。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-notification.md b/zh-cn/application-dev/reference/apis/js-apis-system-notification.md index e0fac1ec7e40cf7d7f7256648e9003f05cbefc9a..dd4b4c6c9cde639d8cf66f92d4b77b1deab7f5c9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-notification.md @@ -13,10 +13,31 @@ import notification from '@system.notification'; ``` +## ActionResult + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | +| ----------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | +| bundleName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Bundle名。 | +| abilityName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Ability名称。 | +| uri | 是 | 是 | string | 否 | 要重定向到的页面的uri。 | + + +## ShowNotificationOptions + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | +| ------------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | +| contentTitle | 是 | 是 | string | 否 | 通知标题。 | +| contentText | 是 | 是 | string | 否 | 通知内容。 | +| clickAction | 是 | 是 | ActionResult | 否 | 通知被点击后触发的行为。 | + ## notification.show -show(contentTitle: string, contentText: string, clickAction: ActionInfo): void +show(options?: ShowNotificationOptions): void 显示通知。 @@ -26,21 +47,10 @@ show(contentTitle: string, contentText: string, clickAction: ActionInfo): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| contentTitle | string | 否 | 通知标题。 | -| contentText | string | 否 | 通知内容。 | -| clickAction | ActionInfo | 否 | 通知点击后触发的动作。 | - - **表1** ActionInfo - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| bundleName | string | 是 | 点击通知后要跳转到的应用的bundleName | -| abilityName | string | 是 | 点击通知后要跳转到的应用的abilityName | -| uri | string | 是 | 要跳转到的uri,可以是下面的两种格式:
- 页面绝对路径,由配置文件中pages列表提供,例如:
  - pages/index/index
  - pages/detail/detail
- 特殊的,如果uri的值是"/",则跳转到首页。 | +| options | ShowNotificationOptions | 否 | 通知标题。 | **示例:** - -``` +```javascript export default { show() { notification.show({