提交 060c476f 编写于 作者: X xuzhihao

Fix issues of Notification docs

Signed-off-by: Nxuzhihao <xuzhihao16@huawei.com>
上级 6819dad0
...@@ -2924,7 +2924,7 @@ function enableSlotCallback(err) { ...@@ -2924,7 +2924,7 @@ function enableSlotCallback(err) {
Notification.enableNotificationSlot( Notification.enableNotificationSlot(
{ bundle: "ohos.samples.notification", }, { bundle: "ohos.samples.notification", },
notify.SlotType.SOCIAL_COMMUNICATION, Notification.SlotType.SOCIAL_COMMUNICATION,
true, true,
enableSlotCallback); enableSlotCallback);
``` ```
...@@ -2953,7 +2953,7 @@ enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): P ...@@ -2953,7 +2953,7 @@ enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): P
//enableNotificationSlot //enableNotificationSlot
Notification.enableNotificationSlot( Notification.enableNotificationSlot(
{ bundle: "ohos.samples.notification", }, { bundle: "ohos.samples.notification", },
notify.SlotType.SOCIAL_COMMUNICATION, Notification.SlotType.SOCIAL_COMMUNICATION,
true).then(() => { true).then(() => {
console.log('====================>enableNotificationSlot====================>'); console.log('====================>enableNotificationSlot====================>');
}); });
...@@ -2961,7 +2961,7 @@ Notification.enableNotificationSlot( ...@@ -2961,7 +2961,7 @@ Notification.enableNotificationSlot(
## Notification.isNotificationSlotEnabled <sup>9+</sup> ## Notification.isNotificationSlotEnabled <sup>9+</sup>
isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback<boolean>): void isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback\<boolean\>): void
获取指定类型的渠道使能状态(Callback形式)。 获取指定类型的渠道使能状态(Callback形式)。
...@@ -2975,7 +2975,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC ...@@ -2975,7 +2975,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC
| -------- | ----------------------------- | ---- | ---------------------- | | -------- | ----------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 | | bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 |
| type | [SlotType](#slottype) | 是 | 指定渠道类型。 | | type | [SlotType](#slottype) | 是 | 指定渠道类型。 |
| callback | AsyncCallback\<void\> | 是 | 设定渠道使能回调函数。 | | callback | AsyncCallback\<boolean\> | 是 | 设定渠道使能回调函数。 |
**示例:** **示例:**
...@@ -2987,13 +2987,13 @@ function getEnableSlotCallback(err, data) { ...@@ -2987,13 +2987,13 @@ function getEnableSlotCallback(err, data) {
Notification.isNotificationSlotEnabled( Notification.isNotificationSlotEnabled(
{ bundle: "ohos.samples.notification", }, { bundle: "ohos.samples.notification", },
notify.SlotType.SOCIAL_COMMUNICATION, Notification.SlotType.SOCIAL_COMMUNICATION,
getEnableSlotCallback); getEnableSlotCallback);
``` ```
## Notification.isNotificationSlotEnabled <sup>9+</sup> ## Notification.isNotificationSlotEnabled <sup>9+</sup>
isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean> isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\<boolean\>
获取指定类型的渠道使能状态(Promise形式)。 获取指定类型的渠道使能状态(Promise形式)。
...@@ -3014,8 +3014,8 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean ...@@ -3014,8 +3014,8 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean
//isNotificationSlotEnabled //isNotificationSlotEnabled
Notification.isNotificationSlotEnabled( Notification.isNotificationSlotEnabled(
{ bundle: "ohos.samples.notification", }, { bundle: "ohos.samples.notification", },
notify.SlotType.SOCIAL_COMMUNICATION, Notification.SlotType.SOCIAL_COMMUNICATION
true).then((data) => { ).then((data) => {
console.log('====================>isNotificationSlotEnabled====================>'); console.log('====================>isNotificationSlotEnabled====================>');
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册