未验证 提交 c7396e38 编写于 作者: O openharmony_ci 提交者: Gitee

!3373 后台代理提醒-更新示例

Merge pull request !3373 from rcy-hw/0326
...@@ -275,6 +275,8 @@ Adds a reminder notification slot. This API uses an asynchronous callback to ret ...@@ -275,6 +275,8 @@ Adds a reminder notification slot. This API uses an asynchronous callback to ret
**Example** **Example**
```js ```js
import notification from '@ohos.notification'
let mySlot = { let mySlot = {
type: notification.SlotType.SOCIAL_COMMUNICATION type: notification.SlotType.SOCIAL_COMMUNICATION
} }
...@@ -307,6 +309,8 @@ Adds a reminder notification slot. This API uses a promise to return the result. ...@@ -307,6 +309,8 @@ Adds a reminder notification slot. This API uses a promise to return the result.
**Example** **Example**
```js ```js
import notification from '@ohos.notification'
let mySlot = { let mySlot = {
type: notification.SlotType.SOCIAL_COMMUNICATION type: notification.SlotType.SOCIAL_COMMUNICATION
} }
...@@ -334,6 +338,8 @@ Removes a notification slot of a specified type. This API uses an asynchronous c ...@@ -334,6 +338,8 @@ Removes a notification slot of a specified type. This API uses an asynchronous c
**Example** **Example**
```js ```js
import notification from '@ohos.notification'
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => { reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => {
console.log("removeNotificationSlot callback"); console.log("removeNotificationSlot callback");
}); });
...@@ -363,6 +369,8 @@ Removes a notification slot of a specified type. This API uses a promise to retu ...@@ -363,6 +369,8 @@ Removes a notification slot of a specified type. This API uses a promise to retu
**Example** **Example**
```js ```js
import notification from '@ohos.notification'
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
console.log("removeNotificationSlot promise"); console.log("removeNotificationSlot promise");
}); });
......
...@@ -272,12 +272,11 @@ addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>) ...@@ -272,12 +272,11 @@ addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>)
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 |
| callback | AsyncCallback<void> | 是 | 异步回调。 | | callback | AsyncCallback<void> | 是 | 异步回调。 |
**说明**
使用NotificationSlot需要导入: import notification from '@ohos.notification'
**示例** **示例**
```js ```js
import notification from '@ohos.notification'
let mySlot = { let mySlot = {
type: notification.SlotType.SOCIAL_COMMUNICATION type: notification.SlotType.SOCIAL_COMMUNICATION
} }
...@@ -301,9 +300,6 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> ...@@ -301,9 +300,6 @@ addNotificationSlot(slot: NotificationSlot): Promise<void>
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 |
**说明**
使用NotificationSlot需要导入: import notification from '@ohos.notification'
**返回值** **返回值**
| 类型 | 说明 | | 类型 | 说明 |
...@@ -313,6 +309,8 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> ...@@ -313,6 +309,8 @@ addNotificationSlot(slot: NotificationSlot): Promise<void>
**示例** **示例**
```js ```js
import notification from '@ohos.notification'
let mySlot = { let mySlot = {
type: notification.SlotType.SOCIAL_COMMUNICATION type: notification.SlotType.SOCIAL_COMMUNICATION
} }
...@@ -340,6 +338,8 @@ removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback& ...@@ -340,6 +338,8 @@ removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback&
**示例** **示例**
```js ```js
import notification from '@ohos.notification'
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => { reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => {
console.log("removeNotificationSlot callback"); console.log("removeNotificationSlot callback");
}); });
...@@ -369,6 +369,8 @@ removeNotificationSlot(slotType: notification.SlotType): Promise<void> ...@@ -369,6 +369,8 @@ removeNotificationSlot(slotType: notification.SlotType): Promise<void>
**示例** **示例**
```js ```js
import notification from '@ohos.notification'
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
console.log("removeNotificationSlot promise"); console.log("removeNotificationSlot promise");
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册