提交 a6fc9360 编写于 作者: E ester.zhou

update docs (14558)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 be46489b
# @ohos.notificationManager # @ohos.notificationManager (NotificationManager)
The **notificationManager** module provides notification management capabilities, covering notifications, notification slots, notification enabled status, and notification badge status. The **notificationManager** module provides notification management capabilities, covering notifications, notification slots, notification enabled status, and notification badge status.
...@@ -29,6 +29,8 @@ Publishes a notification. This API uses an asynchronous callback to return the r ...@@ -29,6 +29,8 @@ Publishes a notification. This API uses an asynchronous callback to return the r
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -50,7 +52,7 @@ function publishCallback(err) { ...@@ -50,7 +52,7 @@ function publishCallback(err) {
} }
} }
// NotificationRequest object // NotificationRequest object
var notificationRequest = { let notificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -60,8 +62,8 @@ var notificationRequest = { ...@@ -60,8 +62,8 @@ var notificationRequest = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
Notification.publish(notificationRequest, publishCallback) Notification.publish(notificationRequest, publishCallback);
``` ```
...@@ -82,6 +84,8 @@ Publishes a notification. This API uses a promise to return the result. ...@@ -82,6 +84,8 @@ Publishes a notification. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -95,7 +99,7 @@ Publishes a notification. This API uses a promise to return the result. ...@@ -95,7 +99,7 @@ Publishes a notification. This API uses a promise to return the result.
```js ```js
// NotificationRequest object // NotificationRequest object
var notificationRequest = { let notificationRequest = {
notificationId: 1, notificationId: 1,
content: { content: {
contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -105,7 +109,7 @@ var notificationRequest = { ...@@ -105,7 +109,7 @@ var notificationRequest = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
Notification.publish(notificationRequest).then(() => { Notification.publish(notificationRequest).then(() => {
console.info("publish success"); console.info("publish success");
}); });
...@@ -134,6 +138,8 @@ Publishes a notification to a specified user. This API uses an asynchronous call ...@@ -134,6 +138,8 @@ Publishes a notification to a specified user. This API uses an asynchronous call
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -156,9 +162,9 @@ function publishCallback(err) { ...@@ -156,9 +162,9 @@ function publishCallback(err) {
} }
} }
// User ID // User ID
var userId = 1 let userId = 1;
// NotificationRequest object // NotificationRequest object
var notificationRequest = { let notificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -168,7 +174,7 @@ var notificationRequest = { ...@@ -168,7 +174,7 @@ var notificationRequest = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
Notification.publish(notificationRequest, userId, publishCallback); Notification.publish(notificationRequest, userId, publishCallback);
``` ```
...@@ -193,6 +199,8 @@ Publishes a notification to a specified user. This API uses a promise to return ...@@ -193,6 +199,8 @@ Publishes a notification to a specified user. This API uses a promise to return
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -206,7 +214,7 @@ Publishes a notification to a specified user. This API uses a promise to return ...@@ -206,7 +214,7 @@ Publishes a notification to a specified user. This API uses a promise to return
**Example** **Example**
```js ```js
var notificationRequest = { let notificationRequest = {
notificationId: 1, notificationId: 1,
content: { content: {
contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -216,9 +224,9 @@ var notificationRequest = { ...@@ -216,9 +224,9 @@ var notificationRequest = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
var userId = 1 let userId = 1;
Notification.publish(notificationRequest, userId).then(() => { Notification.publish(notificationRequest, userId).then(() => {
console.info("publish success"); console.info("publish success");
...@@ -244,6 +252,8 @@ Cancels a notification with the specified ID and label. This API uses an asynchr ...@@ -244,6 +252,8 @@ Cancels a notification with the specified ID and label. This API uses an asynchr
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -262,7 +272,7 @@ function cancelCallback(err) { ...@@ -262,7 +272,7 @@ function cancelCallback(err) {
console.info("cancel success"); console.info("cancel success");
} }
} }
Notification.cancel(0, "label", cancelCallback) Notification.cancel(0, "label", cancelCallback);
``` ```
...@@ -284,6 +294,8 @@ Cancels a notification with the specified ID and optional label. This API uses a ...@@ -284,6 +294,8 @@ Cancels a notification with the specified ID and optional label. This API uses a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -318,6 +330,8 @@ Cancels a notification with the specified ID. This API uses an asynchronous call ...@@ -318,6 +330,8 @@ Cancels a notification with the specified ID. This API uses an asynchronous call
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -336,7 +350,7 @@ function cancelCallback(err) { ...@@ -336,7 +350,7 @@ function cancelCallback(err) {
console.info("cancel success"); console.info("cancel success");
} }
} }
Notification.cancel(0, cancelCallback) Notification.cancel(0, cancelCallback);
``` ```
...@@ -351,6 +365,8 @@ Cancels all notifications. This API uses an asynchronous callback to return the ...@@ -351,6 +365,8 @@ Cancels all notifications. This API uses an asynchronous callback to return the
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -374,7 +390,7 @@ function cancelAllCallback(err) { ...@@ -374,7 +390,7 @@ function cancelAllCallback(err) {
console.info("cancelAll success"); console.info("cancelAll success");
} }
} }
Notification.cancelAll(cancelAllCallback) Notification.cancelAll(cancelAllCallback);
``` ```
...@@ -389,6 +405,8 @@ Cancels all notifications. This API uses a promise to return the result. ...@@ -389,6 +405,8 @@ Cancels all notifications. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -426,6 +444,8 @@ Adds a notification slot. This API uses an asynchronous callback to return the r ...@@ -426,6 +444,8 @@ Adds a notification slot. This API uses an asynchronous callback to return the r
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -444,10 +464,10 @@ function addSlotCallBack(err) { ...@@ -444,10 +464,10 @@ function addSlotCallBack(err) {
} }
} }
// NotificationSlot object // NotificationSlot object
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
Notification.addSlot(notificationSlot, addSlotCallBack) Notification.addSlot(notificationSlot, addSlotCallBack);
``` ```
...@@ -472,6 +492,8 @@ Adds a notification slot. This API uses a promise to return the result. ...@@ -472,6 +492,8 @@ Adds a notification slot. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -482,9 +504,9 @@ Adds a notification slot. This API uses a promise to return the result. ...@@ -482,9 +504,9 @@ Adds a notification slot. This API uses a promise to return the result.
```js ```js
// NotificationSlot object // NotificationSlot object
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
Notification.addSlot(notificationSlot).then(() => { Notification.addSlot(notificationSlot).then(() => {
console.info("addSlot success"); console.info("addSlot success");
}); });
...@@ -509,6 +531,8 @@ Adds a notification slot of a specified type. This API uses an asynchronous call ...@@ -509,6 +531,8 @@ Adds a notification slot of a specified type. This API uses an asynchronous call
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -526,7 +550,7 @@ function addSlotCallBack(err) { ...@@ -526,7 +550,7 @@ function addSlotCallBack(err) {
console.info("addSlot success"); console.info("addSlot success");
} }
} }
Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack) Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack);
``` ```
...@@ -547,6 +571,8 @@ Adds a notification slot of a specified type. This API uses a promise to return ...@@ -547,6 +571,8 @@ Adds a notification slot of a specified type. This API uses a promise to return
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -584,6 +610,8 @@ Adds an array of notification slots. This API uses an asynchronous callback to r ...@@ -584,6 +610,8 @@ Adds an array of notification slots. This API uses an asynchronous callback to r
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -602,14 +630,14 @@ function addSlotsCallBack(err) { ...@@ -602,14 +630,14 @@ function addSlotsCallBack(err) {
} }
} }
// NotificationSlot object // NotificationSlot object
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
// NotificationSlotArray object // NotificationSlotArray object
var notificationSlotArray = new Array(); let notificationSlotArray = new Array();
notificationSlotArray[0] = notificationSlot; notificationSlotArray[0] = notificationSlot;
Notification.addSlots(notificationSlotArray, addSlotsCallBack) Notification.addSlots(notificationSlotArray, addSlotsCallBack);
``` ```
...@@ -634,6 +662,8 @@ Adds an array of notification slots. This API uses a promise to return the resul ...@@ -634,6 +662,8 @@ Adds an array of notification slots. This API uses a promise to return the resul
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -644,11 +674,11 @@ Adds an array of notification slots. This API uses a promise to return the resul ...@@ -644,11 +674,11 @@ Adds an array of notification slots. This API uses a promise to return the resul
```js ```js
// NotificationSlot object // NotificationSlot object
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
// NotificationSlotArray object // NotificationSlotArray object
var notificationSlotArray = new Array(); let notificationSlotArray = new Array();
notificationSlotArray[0] = notificationSlot; notificationSlotArray[0] = notificationSlot;
Notification.addSlots(notificationSlotArray).then(() => { Notification.addSlots(notificationSlotArray).then(() => {
...@@ -675,6 +705,8 @@ Obtains a notification slot of a specified type. This API uses an asynchronous c ...@@ -675,6 +705,8 @@ Obtains a notification slot of a specified type. This API uses an asynchronous c
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -692,8 +724,8 @@ function getSlotCallback(err,data) { ...@@ -692,8 +724,8 @@ function getSlotCallback(err,data) {
console.info("getSlot success"); console.info("getSlot success");
} }
} }
var slotType = Notification.SlotType.SOCIAL_COMMUNICATION; let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.getSlot(slotType, getSlotCallback) Notification.getSlot(slotType, getSlotCallback);
``` ```
...@@ -720,6 +752,8 @@ Obtains a notification slot of a specified type. This API uses a promise to retu ...@@ -720,6 +752,8 @@ Obtains a notification slot of a specified type. This API uses a promise to retu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -729,7 +763,7 @@ Obtains a notification slot of a specified type. This API uses a promise to retu ...@@ -729,7 +763,7 @@ Obtains a notification slot of a specified type. This API uses a promise to retu
**Example** **Example**
```js ```js
var slotType = Notification.SlotType.SOCIAL_COMMUNICATION; let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.getSlot(slotType).then((data) => { Notification.getSlot(slotType).then((data) => {
console.info("getSlot success, data: " + JSON.stringify(data)); console.info("getSlot success, data: " + JSON.stringify(data));
}); });
...@@ -753,6 +787,8 @@ Obtains all notification slots of this application. This API uses an asynchronou ...@@ -753,6 +787,8 @@ Obtains all notification slots of this application. This API uses an asynchronou
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -770,7 +806,7 @@ function getSlotsCallback(err,data) { ...@@ -770,7 +806,7 @@ function getSlotsCallback(err,data) {
console.info("getSlots success"); console.info("getSlots success");
} }
} }
Notification.getSlots(getSlotsCallback) Notification.getSlots(getSlotsCallback);
``` ```
...@@ -791,6 +827,8 @@ Obtains all notification slots of this application. This API uses a promise to r ...@@ -791,6 +827,8 @@ Obtains all notification slots of this application. This API uses a promise to r
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -824,6 +862,8 @@ Removes a notification slot of a specified type. This API uses an asynchronous c ...@@ -824,6 +862,8 @@ Removes a notification slot of a specified type. This API uses an asynchronous c
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -841,8 +881,8 @@ function removeSlotCallback(err) { ...@@ -841,8 +881,8 @@ function removeSlotCallback(err) {
console.info("removeSlot success"); console.info("removeSlot success");
} }
} }
var slotType = Notification.SlotType.SOCIAL_COMMUNICATION; let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.removeSlot(slotType,removeSlotCallback) Notification.removeSlot(slotType,removeSlotCallback);
``` ```
...@@ -863,6 +903,8 @@ Removes a notification slot of a specified type. This API uses a promise to retu ...@@ -863,6 +903,8 @@ Removes a notification slot of a specified type. This API uses a promise to retu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -872,7 +914,7 @@ Removes a notification slot of a specified type. This API uses a promise to retu ...@@ -872,7 +914,7 @@ Removes a notification slot of a specified type. This API uses a promise to retu
**Example** **Example**
```js ```js
var slotType = Notification.SlotType.SOCIAL_COMMUNICATION; let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.removeSlot(slotType).then(() => { Notification.removeSlot(slotType).then(() => {
console.info("removeSlot success"); console.info("removeSlot success");
}); });
...@@ -896,6 +938,8 @@ Removes all notification slots. This API uses an asynchronous callback to return ...@@ -896,6 +938,8 @@ Removes all notification slots. This API uses an asynchronous callback to return
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -912,7 +956,7 @@ function removeAllCallBack(err) { ...@@ -912,7 +956,7 @@ function removeAllCallBack(err) {
console.info("removeAllSlots success"); console.info("removeAllSlots success");
} }
} }
Notification.removeAllSlots(removeAllCallBack) Notification.removeAllSlots(removeAllCallBack);
``` ```
...@@ -927,6 +971,8 @@ Removes all notification slots. This API uses a promise to return the result. ...@@ -927,6 +971,8 @@ Removes all notification slots. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -965,6 +1011,8 @@ Sets whether to enable notification for a specified application. This API uses a ...@@ -965,6 +1011,8 @@ Sets whether to enable notification for a specified application. This API uses a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -982,9 +1030,9 @@ function setNotificationEnablenCallback(err) { ...@@ -982,9 +1030,9 @@ function setNotificationEnablenCallback(err) {
console.info("setNotificationEnablenCallback success"); console.info("setNotificationEnablenCallback success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.setNotificationEnable(bundle, false, setNotificationEnablenCallback); Notification.setNotificationEnable(bundle, false, setNotificationEnablenCallback);
``` ```
...@@ -1011,6 +1059,8 @@ Sets whether to enable notification for a specified application. This API uses a ...@@ -1011,6 +1059,8 @@ Sets whether to enable notification for a specified application. This API uses a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1021,9 +1071,9 @@ Sets whether to enable notification for a specified application. This API uses a ...@@ -1021,9 +1071,9 @@ Sets whether to enable notification for a specified application. This API uses a
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.setNotificationEnable(bundle, false).then(() => { Notification.setNotificationEnable(bundle, false).then(() => {
console.info("setNotificationEnable success"); console.info("setNotificationEnable success");
}); });
...@@ -1052,6 +1102,8 @@ Checks whether notification is enabled for a specified application. This API use ...@@ -1052,6 +1102,8 @@ Checks whether notification is enabled for a specified application. This API use
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1069,9 +1121,9 @@ function isNotificationEnabledCallback(err, data) { ...@@ -1069,9 +1121,9 @@ function isNotificationEnabledCallback(err, data) {
console.info("isNotificationEnabled success"); console.info("isNotificationEnabled success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isNotificationEnabled(bundle, isNotificationEnabledCallback); Notification.isNotificationEnabled(bundle, isNotificationEnabledCallback);
``` ```
...@@ -1103,6 +1155,8 @@ Checks whether notification is enabled for a specified application. This API use ...@@ -1103,6 +1155,8 @@ Checks whether notification is enabled for a specified application. This API use
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1113,9 +1167,9 @@ Checks whether notification is enabled for a specified application. This API use ...@@ -1113,9 +1167,9 @@ Checks whether notification is enabled for a specified application. This API use
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isNotificationEnabled(bundle).then((data) => { Notification.isNotificationEnabled(bundle).then((data) => {
console.info("isNotificationEnabled success, data: " + JSON.stringify(data)); console.info("isNotificationEnabled success, data: " + JSON.stringify(data));
}); });
...@@ -1143,6 +1197,8 @@ Checks whether notification is enabled for this application. This API uses an as ...@@ -1143,6 +1197,8 @@ Checks whether notification is enabled for this application. This API uses an as
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1191,6 +1247,8 @@ Checks whether notification is enabled for the current application. This API use ...@@ -1191,6 +1247,8 @@ Checks whether notification is enabled for the current application. This API use
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1230,6 +1288,8 @@ Sets whether to enable the notification badge for a specified application. This ...@@ -1230,6 +1288,8 @@ Sets whether to enable the notification badge for a specified application. This
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1247,9 +1307,9 @@ function displayBadgeCallback(err) { ...@@ -1247,9 +1307,9 @@ function displayBadgeCallback(err) {
console.info("displayBadge success"); console.info("displayBadge success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.displayBadge(bundle, false, displayBadgeCallback); Notification.displayBadge(bundle, false, displayBadgeCallback);
``` ```
...@@ -1276,6 +1336,8 @@ Sets whether to enable the notification badge for a specified application. This ...@@ -1276,6 +1336,8 @@ Sets whether to enable the notification badge for a specified application. This
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1286,9 +1348,9 @@ Sets whether to enable the notification badge for a specified application. This ...@@ -1286,9 +1348,9 @@ Sets whether to enable the notification badge for a specified application. This
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.displayBadge(bundle, false).then(() => { Notification.displayBadge(bundle, false).then(() => {
console.info("displayBadge success"); console.info("displayBadge success");
}); });
...@@ -1317,6 +1379,8 @@ Checks whether the notification badge is enabled for a specified application. Th ...@@ -1317,6 +1379,8 @@ Checks whether the notification badge is enabled for a specified application. Th
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1334,9 +1398,9 @@ function isBadgeDisplayedCallback(err, data) { ...@@ -1334,9 +1398,9 @@ function isBadgeDisplayedCallback(err, data) {
console.info("isBadgeDisplayed success"); console.info("isBadgeDisplayed success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isBadgeDisplayed(bundle, isBadgeDisplayedCallback); Notification.isBadgeDisplayed(bundle, isBadgeDisplayedCallback);
``` ```
...@@ -1368,6 +1432,8 @@ Checks whether the notification badge is enabled for a specified application. Th ...@@ -1368,6 +1432,8 @@ Checks whether the notification badge is enabled for a specified application. Th
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1378,9 +1444,9 @@ Checks whether the notification badge is enabled for a specified application. Th ...@@ -1378,9 +1444,9 @@ Checks whether the notification badge is enabled for a specified application. Th
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isBadgeDisplayed(bundle).then((data) => { Notification.isBadgeDisplayed(bundle).then((data) => {
console.info("isBadgeDisplayed success, data: " + JSON.stringify(data)); console.info("isBadgeDisplayed success, data: " + JSON.stringify(data));
}); });
...@@ -1410,6 +1476,8 @@ Sets the notification slot for a specified application. This API uses an asynchr ...@@ -1410,6 +1476,8 @@ Sets the notification slot for a specified application. This API uses an asynchr
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1429,12 +1497,12 @@ function setSlotByBundleCallback(err) { ...@@ -1429,12 +1497,12 @@ function setSlotByBundleCallback(err) {
console.info("setSlotByBundle success"); console.info("setSlotByBundle success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
Notification.setSlotByBundle(bundle, notificationSlot, setSlotByBundleCallback); Notification.setSlotByBundle(bundle, notificationSlot, setSlotByBundleCallback);
``` ```
...@@ -1461,6 +1529,8 @@ Sets the notification slot for a specified application. This API uses a promise ...@@ -1461,6 +1529,8 @@ Sets the notification slot for a specified application. This API uses a promise
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1471,12 +1541,12 @@ Sets the notification slot for a specified application. This API uses a promise ...@@ -1471,12 +1541,12 @@ Sets the notification slot for a specified application. This API uses a promise
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var notificationSlot = { let notificationSlot = {
type: Notification.SlotType.SOCIAL_COMMUNICATION type: Notification.SlotType.SOCIAL_COMMUNICATION
} };
Notification.setSlotByBundle(bundle, notificationSlot).then(() => { Notification.setSlotByBundle(bundle, notificationSlot).then(() => {
console.info("setSlotByBundle success"); console.info("setSlotByBundle success");
}); });
...@@ -1505,6 +1575,8 @@ Obtains the notification slots of a specified application. This API uses an asyn ...@@ -1505,6 +1575,8 @@ Obtains the notification slots of a specified application. This API uses an asyn
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1522,9 +1594,9 @@ function getSlotsByBundleCallback(err, data) { ...@@ -1522,9 +1594,9 @@ function getSlotsByBundleCallback(err, data) {
console.info("getSlotsByBundle success"); console.info("getSlotsByBundle success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.getSlotsByBundle(bundle, getSlotsByBundleCallback); Notification.getSlotsByBundle(bundle, getSlotsByBundleCallback);
``` ```
...@@ -1556,6 +1628,8 @@ Obtains the notification slots of a specified application. This API uses a promi ...@@ -1556,6 +1628,8 @@ Obtains the notification slots of a specified application. This API uses a promi
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1566,9 +1640,9 @@ Obtains the notification slots of a specified application. This API uses a promi ...@@ -1566,9 +1640,9 @@ Obtains the notification slots of a specified application. This API uses a promi
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.getSlotsByBundle(bundle).then((data) => { Notification.getSlotsByBundle(bundle).then((data) => {
console.info("getSlotsByBundle success, data: " + JSON.stringify(data)); console.info("getSlotsByBundle success, data: " + JSON.stringify(data));
}); });
...@@ -1597,6 +1671,8 @@ Obtains the number of notification slots of a specified application. This API us ...@@ -1597,6 +1671,8 @@ Obtains the number of notification slots of a specified application. This API us
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1614,9 +1690,9 @@ function getSlotNumByBundleCallback(err, data) { ...@@ -1614,9 +1690,9 @@ function getSlotNumByBundleCallback(err, data) {
console.info("getSlotNumByBundle success"); console.info("getSlotNumByBundle success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.getSlotNumByBundle(bundle, getSlotNumByBundleCallback); Notification.getSlotNumByBundle(bundle, getSlotNumByBundleCallback);
``` ```
...@@ -1648,6 +1724,8 @@ Obtains the number of notification slots of a specified application. This API us ...@@ -1648,6 +1724,8 @@ Obtains the number of notification slots of a specified application. This API us
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1658,9 +1736,9 @@ Obtains the number of notification slots of a specified application. This API us ...@@ -1658,9 +1736,9 @@ Obtains the number of notification slots of a specified application. This API us
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.getSlotNumByBundle(bundle).then((data) => { Notification.getSlotNumByBundle(bundle).then((data) => {
console.info("getSlotNumByBundle success, data: " + JSON.stringify(data)); console.info("getSlotNumByBundle success, data: " + JSON.stringify(data));
}); });
...@@ -1689,6 +1767,8 @@ Obtains all active notifications. This API uses an asynchronous callback to retu ...@@ -1689,6 +1767,8 @@ Obtains all active notifications. This API uses an asynchronous callback to retu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1731,6 +1811,8 @@ Obtains all active notifications. This API uses a promise to return the result. ...@@ -1731,6 +1811,8 @@ Obtains all active notifications. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1763,6 +1845,8 @@ Obtains the number of active notifications of this application. This API uses an ...@@ -1763,6 +1845,8 @@ Obtains the number of active notifications of this application. This API uses an
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1801,6 +1885,8 @@ Obtains the number of active notifications of this application. This API uses a ...@@ -1801,6 +1885,8 @@ Obtains the number of active notifications of this application. This API uses a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1833,6 +1919,8 @@ Obtains active notifications of this application. This API uses an asynchronous ...@@ -1833,6 +1919,8 @@ Obtains active notifications of this application. This API uses an asynchronous
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1871,6 +1959,8 @@ Obtains active notifications of this application. This API uses a promise to ret ...@@ -1871,6 +1959,8 @@ Obtains active notifications of this application. This API uses a promise to ret
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1904,6 +1994,8 @@ Cancels notifications under a notification group of this application. This API u ...@@ -1904,6 +1994,8 @@ Cancels notifications under a notification group of this application. This API u
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1944,6 +2036,8 @@ Cancels notifications under a notification group of this application. This API u ...@@ -1944,6 +2036,8 @@ Cancels notifications under a notification group of this application. This API u
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -1953,7 +2047,7 @@ Cancels notifications under a notification group of this application. This API u ...@@ -1953,7 +2047,7 @@ Cancels notifications under a notification group of this application. This API u
**Example** **Example**
```js ```js
var groupName = "GroupName"; let groupName = "GroupName";
Notification.cancelGroup(groupName).then(() => { Notification.cancelGroup(groupName).then(() => {
console.info("cancelGroup success"); console.info("cancelGroup success");
}); });
...@@ -1983,6 +2077,8 @@ Removes notifications under a notification group of a specified application. Thi ...@@ -1983,6 +2077,8 @@ Removes notifications under a notification group of a specified application. Thi
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2001,8 +2097,8 @@ function removeGroupByBundleCallback(err) { ...@@ -2001,8 +2097,8 @@ function removeGroupByBundleCallback(err) {
} }
} }
var bundleOption = {bundle: "Bundle"}; let bundleOption = {bundle: "Bundle"};
var groupName = "GroupName"; let groupName = "GroupName";
Notification.removeGroupByBundle(bundleOption, groupName, removeGroupByBundleCallback); Notification.removeGroupByBundle(bundleOption, groupName, removeGroupByBundleCallback);
``` ```
...@@ -2030,6 +2126,8 @@ Removes notifications under a notification group of a specified application. Thi ...@@ -2030,6 +2126,8 @@ Removes notifications under a notification group of a specified application. Thi
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2040,8 +2138,8 @@ Removes notifications under a notification group of a specified application. Thi ...@@ -2040,8 +2138,8 @@ Removes notifications under a notification group of a specified application. Thi
**Example** **Example**
```js ```js
var bundleOption = {bundle: "Bundle"}; let bundleOption = {bundle: "Bundle"};
var groupName = "GroupName"; let groupName = "GroupName";
Notification.removeGroupByBundle(bundleOption, groupName).then(() => { Notification.removeGroupByBundle(bundleOption, groupName).then(() => {
console.info("removeGroupByBundle success"); console.info("removeGroupByBundle success");
}); });
...@@ -2070,6 +2168,8 @@ Sets the DND time. This API uses an asynchronous callback to return the result. ...@@ -2070,6 +2168,8 @@ Sets the DND time. This API uses an asynchronous callback to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2087,11 +2187,11 @@ function setDoNotDisturbDateCallback(err) { ...@@ -2087,11 +2187,11 @@ function setDoNotDisturbDateCallback(err) {
} }
} }
var doNotDisturbDate = { let doNotDisturbDate = {
type: Notification.DoNotDisturbType.TYPE_ONCE, type: Notification.DoNotDisturbType.TYPE_ONCE,
begin: new Date(), begin: new Date(),
end: new Date(2021, 11, 15, 18, 0) end: new Date(2021, 11, 15, 18, 0)
} };
Notification.setDoNotDisturbDate(doNotDisturbDate, setDoNotDisturbDateCallback); Notification.setDoNotDisturbDate(doNotDisturbDate, setDoNotDisturbDateCallback);
``` ```
...@@ -2118,6 +2218,8 @@ Sets the DND time. This API uses a promise to return the result. ...@@ -2118,6 +2218,8 @@ Sets the DND time. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2127,11 +2229,11 @@ Sets the DND time. This API uses a promise to return the result. ...@@ -2127,11 +2229,11 @@ Sets the DND time. This API uses a promise to return the result.
**Example** **Example**
```js ```js
var doNotDisturbDate = { let doNotDisturbDate = {
type: Notification.DoNotDisturbType.TYPE_ONCE, type: Notification.DoNotDisturbType.TYPE_ONCE,
begin: new Date(), begin: new Date(),
end: new Date(2021, 11, 15, 18, 0) end: new Date(2021, 11, 15, 18, 0)
} };
Notification.setDoNotDisturbDate(doNotDisturbDate).then(() => { Notification.setDoNotDisturbDate(doNotDisturbDate).then(() => {
console.info("setDoNotDisturbDate success"); console.info("setDoNotDisturbDate success");
}); });
...@@ -2160,6 +2262,8 @@ Sets the DND time for a specified user. This API uses an asynchronous callback t ...@@ -2160,6 +2262,8 @@ Sets the DND time for a specified user. This API uses an asynchronous callback t
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2178,13 +2282,13 @@ function setDoNotDisturbDateCallback(err) { ...@@ -2178,13 +2282,13 @@ function setDoNotDisturbDateCallback(err) {
} }
} }
var doNotDisturbDate = { let doNotDisturbDate = {
type: Notification.DoNotDisturbType.TYPE_ONCE, type: Notification.DoNotDisturbType.TYPE_ONCE,
begin: new Date(), begin: new Date(),
end: new Date(2021, 11, 15, 18, 0) end: new Date(2021, 11, 15, 18, 0)
} };
var userId = 1 let userId = 1;
Notification.setDoNotDisturbDate(doNotDisturbDate, userId, setDoNotDisturbDateCallback); Notification.setDoNotDisturbDate(doNotDisturbDate, userId, setDoNotDisturbDateCallback);
``` ```
...@@ -2212,6 +2316,8 @@ Sets the DND time for a specified user. This API uses a promise to return the re ...@@ -2212,6 +2316,8 @@ Sets the DND time for a specified user. This API uses a promise to return the re
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2222,13 +2328,13 @@ Sets the DND time for a specified user. This API uses a promise to return the re ...@@ -2222,13 +2328,13 @@ Sets the DND time for a specified user. This API uses a promise to return the re
**Example** **Example**
```js ```js
var doNotDisturbDate = { let doNotDisturbDate = {
type: Notification.DoNotDisturbType.TYPE_ONCE, type: Notification.DoNotDisturbType.TYPE_ONCE,
begin: new Date(), begin: new Date(),
end: new Date(2021, 11, 15, 18, 0) end: new Date(2021, 11, 15, 18, 0)
} };
var userId = 1 let userId = 1;
Notification.setDoNotDisturbDate(doNotDisturbDate, userId).then(() => { Notification.setDoNotDisturbDate(doNotDisturbDate, userId).then(() => {
console.info("setDoNotDisturbDate success"); console.info("setDoNotDisturbDate success");
...@@ -2256,6 +2362,8 @@ Obtains the DND time. This API uses an asynchronous callback to return the resul ...@@ -2256,6 +2362,8 @@ Obtains the DND time. This API uses an asynchronous callback to return the resul
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2298,6 +2406,8 @@ Obtains the DND time. This API uses a promise to return the result. ...@@ -2298,6 +2406,8 @@ Obtains the DND time. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2334,6 +2444,8 @@ Obtains the DND time of a specified user. This API uses an asynchronous callback ...@@ -2334,6 +2444,8 @@ Obtains the DND time of a specified user. This API uses an asynchronous callback
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2352,7 +2464,7 @@ function getDoNotDisturbDateCallback(err,data) { ...@@ -2352,7 +2464,7 @@ function getDoNotDisturbDateCallback(err,data) {
} }
} }
var userId = 1 let userId = 1;
Notification.getDoNotDisturbDate(userId, getDoNotDisturbDateCallback); Notification.getDoNotDisturbDate(userId, getDoNotDisturbDateCallback);
``` ```
...@@ -2385,6 +2497,8 @@ Obtains the DND time of a specified user. This API uses a promise to return the ...@@ -2385,6 +2497,8 @@ Obtains the DND time of a specified user. This API uses a promise to return the
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2395,7 +2509,7 @@ Obtains the DND time of a specified user. This API uses a promise to return the ...@@ -2395,7 +2509,7 @@ Obtains the DND time of a specified user. This API uses a promise to return the
**Example** **Example**
```js ```js
var userId = 1 let userId = 1;
Notification.getDoNotDisturbDate(userId).then((data) => { Notification.getDoNotDisturbDate(userId).then((data) => {
console.info("getDoNotDisturbDate success, data: " + JSON.stringify(data)); console.info("getDoNotDisturbDate success, data: " + JSON.stringify(data));
...@@ -2403,9 +2517,9 @@ Notification.getDoNotDisturbDate(userId).then((data) => { ...@@ -2403,9 +2517,9 @@ Notification.getDoNotDisturbDate(userId).then((data) => {
``` ```
## Notification.supportDoNotDisturbMode ## Notification.isSupportDoNotDisturbMode
supportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void isSupportDoNotDisturbMode(callback: AsyncCallback\<boolean\>): void
Checks whether DND mode is supported. This API uses an asynchronous callback to return the result. Checks whether DND mode is supported. This API uses an asynchronous callback to return the result.
...@@ -2423,6 +2537,8 @@ Checks whether DND mode is supported. This API uses an asynchronous callback to ...@@ -2423,6 +2537,8 @@ Checks whether DND mode is supported. This API uses an asynchronous callback to
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2432,22 +2548,22 @@ Checks whether DND mode is supported. This API uses an asynchronous callback to ...@@ -2432,22 +2548,22 @@ Checks whether DND mode is supported. This API uses an asynchronous callback to
**Example** **Example**
```js ```js
function supportDoNotDisturbModeCallback(err,data) { function isSupportDoNotDisturbModeCallback(err,data) {
if (err) { if (err) {
console.info("supportDoNotDisturbMode failed " + JSON.stringify(err)); console.info("isSupportDoNotDisturbMode failed " + JSON.stringify(err));
} else { } else {
console.info("supportDoNotDisturbMode success"); console.info("isSupportDoNotDisturbMode success");
} }
} }
Notification.supportDoNotDisturbMode(supportDoNotDisturbModeCallback); Notification.isSupportDoNotDisturbMode(supportDoNotDisturbModeCallback);
``` ```
## Notification.supportDoNotDisturbMode ## Notification.isSupportDoNotDisturbMode
supportDoNotDisturbMode(): Promise\<boolean\> isSupportDoNotDisturbMode(): Promise\<boolean\>
Checks whether DND mode is supported. This API uses a promise to return the result. Checks whether DND mode is supported. This API uses a promise to return the result.
...@@ -2465,6 +2581,8 @@ Checks whether DND mode is supported. This API uses a promise to return the resu ...@@ -2465,6 +2581,8 @@ Checks whether DND mode is supported. This API uses a promise to return the resu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2474,8 +2592,8 @@ Checks whether DND mode is supported. This API uses a promise to return the resu ...@@ -2474,8 +2592,8 @@ Checks whether DND mode is supported. This API uses a promise to return the resu
**Example** **Example**
```js ```js
Notification.supportDoNotDisturbMode().then((data) => { Notification.isSupportDoNotDisturbMode().then((data) => {
console.info("supportDoNotDisturbMode success, data: " + JSON.stringify(data)); console.info("isSupportDoNotDisturbMode success, data: " + JSON.stringify(data));
}); });
``` ```
...@@ -2498,6 +2616,8 @@ Checks whether a specified template is supported. This API uses an asynchronous ...@@ -2498,6 +2616,8 @@ Checks whether a specified template is supported. This API uses an asynchronous
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2508,7 +2628,7 @@ Checks whether a specified template is supported. This API uses an asynchronous ...@@ -2508,7 +2628,7 @@ Checks whether a specified template is supported. This API uses an asynchronous
**Example** **Example**
```javascript ```javascript
var templateName = 'process'; let templateName = 'process';
function isSupportTemplateCallback(err, data) { function isSupportTemplateCallback(err, data) {
if (err) { if (err) {
console.info("isSupportTemplate failed " + JSON.stringify(err)); console.info("isSupportTemplate failed " + JSON.stringify(err));
...@@ -2544,6 +2664,8 @@ Checks whether a specified template is supported. This API uses a promise to ret ...@@ -2544,6 +2664,8 @@ Checks whether a specified template is supported. This API uses a promise to ret
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2554,7 +2676,7 @@ Checks whether a specified template is supported. This API uses a promise to ret ...@@ -2554,7 +2676,7 @@ Checks whether a specified template is supported. This API uses a promise to ret
**Example** **Example**
```javascript ```javascript
var templateName = 'process'; let templateName = 'process';
Notification.isSupportTemplate(templateName).then((data) => { Notification.isSupportTemplate(templateName).then((data) => {
console.info("isSupportTemplate success, data: " + JSON.stringify(data)); console.info("isSupportTemplate success, data: " + JSON.stringify(data));
...@@ -2579,6 +2701,8 @@ Requests notification to be enabled for this application. This API uses an async ...@@ -2579,6 +2701,8 @@ Requests notification to be enabled for this application. This API uses an async
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2611,6 +2735,8 @@ Requests notification to be enabled for this application. This API uses a promis ...@@ -2611,6 +2735,8 @@ Requests notification to be enabled for this application. This API uses a promis
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2648,6 +2774,8 @@ Sets whether this device supports distributed notifications. This API uses an as ...@@ -2648,6 +2774,8 @@ Sets whether this device supports distributed notifications. This API uses an as
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2666,7 +2794,7 @@ function setDistributedEnableCallback() { ...@@ -2666,7 +2794,7 @@ function setDistributedEnableCallback() {
} }
}; };
var enable = true let enable = true;
Notification.setDistributedEnable(enable, setDistributedEnableCallback); Notification.setDistributedEnable(enable, setDistributedEnableCallback);
``` ```
...@@ -2693,6 +2821,8 @@ Sets whether this device supports distributed notifications. This API uses a pro ...@@ -2693,6 +2821,8 @@ Sets whether this device supports distributed notifications. This API uses a pro
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2703,7 +2833,7 @@ Sets whether this device supports distributed notifications. This API uses a pro ...@@ -2703,7 +2833,7 @@ Sets whether this device supports distributed notifications. This API uses a pro
**Example** **Example**
```javascript ```javascript
var enable = true let enable = true;
Notification.setDistributedEnable(enable).then(() => { Notification.setDistributedEnable(enable).then(() => {
console.info("setDistributedEnable success"); console.info("setDistributedEnable success");
...@@ -2727,6 +2857,8 @@ Checks whether this device supports distributed notifications. This API uses an ...@@ -2727,6 +2857,8 @@ Checks whether this device supports distributed notifications. This API uses an
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2766,6 +2898,8 @@ Checks whether this device supports distributed notifications. This API uses a p ...@@ -2766,6 +2898,8 @@ Checks whether this device supports distributed notifications. This API uses a p
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2805,6 +2939,8 @@ Sets whether a specified application supports distributed notifications. This AP ...@@ -2805,6 +2939,8 @@ Sets whether a specified application supports distributed notifications. This AP
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2824,11 +2960,11 @@ function setDistributedEnableByBundleCallback(err) { ...@@ -2824,11 +2960,11 @@ function setDistributedEnableByBundleCallback(err) {
} }
}; };
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var enable = true let enable = true
Notification.setDistributedEnableByBundle(bundle, enable, setDistributedEnableByBundleCallback); Notification.setDistributedEnableByBundle(bundle, enable, setDistributedEnableByBundleCallback);
``` ```
...@@ -2856,6 +2992,8 @@ Sets whether a specified application supports distributed notifications. This AP ...@@ -2856,6 +2992,8 @@ Sets whether a specified application supports distributed notifications. This AP
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2867,11 +3005,11 @@ Sets whether a specified application supports distributed notifications. This AP ...@@ -2867,11 +3005,11 @@ Sets whether a specified application supports distributed notifications. This AP
**Example** **Example**
```javascript ```javascript
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var enable = true let enable = true
Notification.setDistributedEnableByBundle(bundle, enable).then(() => { Notification.setDistributedEnableByBundle(bundle, enable).then(() => {
console.info("setDistributedEnableByBundle success"); console.info("setDistributedEnableByBundle success");
...@@ -2899,6 +3037,8 @@ Checks whether a specified application supports distributed notifications. This ...@@ -2899,6 +3037,8 @@ Checks whether a specified application supports distributed notifications. This
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2918,9 +3058,9 @@ function isDistributedEnabledByBundleCallback(data) { ...@@ -2918,9 +3058,9 @@ function isDistributedEnabledByBundleCallback(data) {
} }
}; };
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isDistributedEnabledByBundle(bundle, isDistributedEnabledByBundleCallback); Notification.isDistributedEnabledByBundle(bundle, isDistributedEnabledByBundleCallback);
``` ```
...@@ -2953,6 +3093,8 @@ Checks whether a specified application supports distributed notifications. This ...@@ -2953,6 +3093,8 @@ Checks whether a specified application supports distributed notifications. This
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -2964,9 +3106,9 @@ Checks whether a specified application supports distributed notifications. This ...@@ -2964,9 +3106,9 @@ Checks whether a specified application supports distributed notifications. This
**Example** **Example**
```javascript ```javascript
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
Notification.isDistributedEnabledByBundle(bundle).then((data) => { Notification.isDistributedEnabledByBundle(bundle).then((data) => {
console.info("isDistributedEnabledByBundle success, data: " + JSON.stringify(data)); console.info("isDistributedEnabledByBundle success, data: " + JSON.stringify(data));
...@@ -2994,6 +3136,8 @@ Obtains the notification reminder type. This API uses an asynchronous callback t ...@@ -2994,6 +3136,8 @@ Obtains the notification reminder type. This API uses an asynchronous callback t
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3036,6 +3180,8 @@ Obtains the notification reminder type. This API uses a promise to return the re ...@@ -3036,6 +3180,8 @@ Obtains the notification reminder type. This API uses a promise to return the re
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3074,6 +3220,8 @@ Publishes a notification through the reminder agent. This API uses an asynchrono ...@@ -3074,6 +3220,8 @@ Publishes a notification through the reminder agent. This API uses an asynchrono
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3096,9 +3244,9 @@ function callback(err) { ...@@ -3096,9 +3244,9 @@ function callback(err) {
} }
} }
// Bundle name of the application whose notification function is taken over by the reminder agent // Bundle name of the application whose notification function is taken over by the reminder agent
let representativeBundle = "com.example.demo" let representativeBundle = "com.example.demo";
// User ID // User ID
let userId = 100 let userId = 100;
// NotificationRequest object // NotificationRequest object
let request = { let request = {
id: 1, id: 1,
...@@ -3110,7 +3258,7 @@ let request = { ...@@ -3110,7 +3258,7 @@ let request = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
Notification.publishAsBundle(request, representativeBundle, userId, callback); Notification.publishAsBundle(request, representativeBundle, userId, callback);
``` ```
...@@ -3138,6 +3286,8 @@ Publishes a notification through the reminder agent. This API uses a promise to ...@@ -3138,6 +3286,8 @@ Publishes a notification through the reminder agent. This API uses a promise to
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------------- | | -------- | ----------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3152,11 +3302,11 @@ Publishes a notification through the reminder agent. This API uses a promise to ...@@ -3152,11 +3302,11 @@ Publishes a notification through the reminder agent. This API uses a promise to
```js ```js
// Bundle name of the application whose notification function is taken over by the reminder agent // Bundle name of the application whose notification function is taken over by the reminder agent
let representativeBundle = "com.example.demo" let representativeBundle = "com.example.demo";
// User ID // User ID
let userId = 100 let userId = 100;
// NotificationRequest object // NotificationRequest object
var request = { let request = {
id: 1, id: 1,
content: { content: {
contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -3166,7 +3316,7 @@ var request = { ...@@ -3166,7 +3316,7 @@ var request = {
additionalText: "test_additionalText" additionalText: "test_additionalText"
} }
} }
} };
Notification.publishAsBundle(request, representativeBundle, userId).then(() => { Notification.publishAsBundle(request, representativeBundle, userId).then(() => {
console.info("publishAsBundle success"); console.info("publishAsBundle success");
...@@ -3198,6 +3348,8 @@ Cancels a notification published by the reminder agent. This API uses an asynchr ...@@ -3198,6 +3348,8 @@ Cancels a notification published by the reminder agent. This API uses an asynchr
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3218,9 +3370,9 @@ function cancelAsBundleCallback(err) { ...@@ -3218,9 +3370,9 @@ function cancelAsBundleCallback(err) {
} }
} }
// Bundle name of the application whose notification function is taken over by the reminder agent // Bundle name of the application whose notification function is taken over by the reminder agent
let representativeBundle = "com.example.demo" let representativeBundle = "com.example.demo";
// User ID // User ID
let userId = 100 let userId = 100;
Notification.cancelAsBundle(0, representativeBundle, userId, cancelAsBundleCallback); Notification.cancelAsBundle(0, representativeBundle, userId, cancelAsBundleCallback);
``` ```
...@@ -3249,6 +3401,8 @@ Cancels a notification published by the reminder agent. This API uses a promise ...@@ -3249,6 +3401,8 @@ Cancels a notification published by the reminder agent. This API uses a promise
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3261,9 +3415,9 @@ Cancels a notification published by the reminder agent. This API uses a promise ...@@ -3261,9 +3415,9 @@ Cancels a notification published by the reminder agent. This API uses a promise
```js ```js
// Bundle name of the application whose notification function is taken over by the reminder agent // Bundle name of the application whose notification function is taken over by the reminder agent
let representativeBundle = "com.example.demo" let representativeBundle = "com.example.demo";
// User ID // User ID
let userId = 100 let userId = 100;
Notification.cancelAsBundle(0, representativeBundle, userId).then(() => { Notification.cancelAsBundle(0, representativeBundle, userId).then(() => {
console.info("cancelAsBundle success"); console.info("cancelAsBundle success");
...@@ -3293,6 +3447,8 @@ Sets whether to enable a specified notification slot type for a specified applic ...@@ -3293,6 +3447,8 @@ Sets whether to enable a specified notification slot type for a specified applic
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3341,6 +3497,8 @@ Sets whether to enable a specified notification slot type for a specified applic ...@@ -3341,6 +3497,8 @@ Sets whether to enable a specified notification slot type for a specified applic
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3382,6 +3540,8 @@ Checks whether a specified notification slot type is enabled for a specified app ...@@ -3382,6 +3540,8 @@ Checks whether a specified notification slot type is enabled for a specified app
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3434,6 +3594,8 @@ Checks whether a specified notification slot type is enabled for a specified app ...@@ -3434,6 +3594,8 @@ Checks whether a specified notification slot type is enabled for a specified app
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3474,6 +3636,8 @@ Sets whether to enable the notification sync feature for devices where the appli ...@@ -3474,6 +3636,8 @@ Sets whether to enable the notification sync feature for devices where the appli
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3526,6 +3690,8 @@ Sets whether to enable the notification sync feature for devices where the appli ...@@ -3526,6 +3690,8 @@ Sets whether to enable the notification sync feature for devices where the appli
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3568,6 +3734,8 @@ Obtains whether the notification sync feature is enabled for devices where the a ...@@ -3568,6 +3734,8 @@ Obtains whether the notification sync feature is enabled for devices where the a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -3618,6 +3786,8 @@ Obtains whether the notification sync feature is enabled for devices where the a ...@@ -3618,6 +3786,8 @@ Obtains whether the notification sync feature is enabled for devices where the a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
......
# @ohos.notificationSubscribe # @ohos.notificationSubscribe (NotificationSubscribe)
The **NotificationSubscribe** module provides APIs for notification subscription, notification unsubscription, subscription removal, and more. In general cases, only system applications can call these APIs. The **NotificationSubscribe** module provides APIs for notification subscription, notification unsubscription, subscription removal, and more. In general cases, only system applications can call these APIs.
...@@ -36,6 +36,8 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -36,6 +36,8 @@ Subscribes to a notification with the subscription information specified. This A
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -56,12 +58,12 @@ function subscribeCallback(err) { ...@@ -56,12 +58,12 @@ function subscribeCallback(err) {
function onConsumeCallback(data) { function onConsumeCallback(data) {
console.info("Consume callback: " + JSON.stringify(data)); console.info("Consume callback: " + JSON.stringify(data));
} }
var subscriber = { let subscriber = {
onConsume: onConsumeCallback onConsume: onConsumeCallback
} };
var info = { let info = {
bundleNames: ["bundleName1","bundleName2"] bundleNames: ["bundleName1","bundleName2"]
} };
NotificationSubscribe.subscribe(subscriber, info, subscribeCallback); NotificationSubscribe.subscribe(subscriber, info, subscribeCallback);
``` ```
...@@ -88,6 +90,8 @@ Subscribes to notifications of all applications under this user. This API uses a ...@@ -88,6 +90,8 @@ Subscribes to notifications of all applications under this user. This API uses a
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -107,9 +111,9 @@ function subscribeCallback(err) { ...@@ -107,9 +111,9 @@ function subscribeCallback(err) {
function onConsumeCallback(data) { function onConsumeCallback(data) {
console.info("Consume callback: " + JSON.stringify(data)); console.info("Consume callback: " + JSON.stringify(data));
} }
var subscriber = { let subscriber = {
onConsume: onConsumeCallback onConsume: onConsumeCallback
} };
NotificationSubscribe.subscribe(subscriber, subscribeCallback); NotificationSubscribe.subscribe(subscriber, subscribeCallback);
``` ```
...@@ -136,6 +140,8 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -136,6 +140,8 @@ Subscribes to a notification with the subscription information specified. This A
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -148,7 +154,7 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -148,7 +154,7 @@ Subscribes to a notification with the subscription information specified. This A
function onConsumeCallback(data) { function onConsumeCallback(data) {
console.info("Consume callback: " + JSON.stringify(data)); console.info("Consume callback: " + JSON.stringify(data));
} }
var subscriber = { let subscriber = {
onConsume: onConsumeCallback onConsume: onConsumeCallback
}; };
NotificationSubscribe.subscribe(subscriber).then(() => { NotificationSubscribe.subscribe(subscriber).then(() => {
...@@ -179,6 +185,8 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu ...@@ -179,6 +185,8 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -198,9 +206,9 @@ function unsubscribeCallback(err) { ...@@ -198,9 +206,9 @@ function unsubscribeCallback(err) {
function onDisconnectCallback(data) { function onDisconnectCallback(data) {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("Cancel callback: " + JSON.stringify(data));
} }
var subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
} };
NotificationSubscribe.unsubscribe(subscriber, unsubscribeCallback); NotificationSubscribe.unsubscribe(subscriber, unsubscribeCallback);
``` ```
...@@ -226,6 +234,8 @@ Unsubscribes from a notification. This API uses a promise to return the result. ...@@ -226,6 +234,8 @@ Unsubscribes from a notification. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -238,7 +248,7 @@ Unsubscribes from a notification. This API uses a promise to return the result. ...@@ -238,7 +248,7 @@ Unsubscribes from a notification. This API uses a promise to return the result.
function onDisconnectCallback(data) { function onDisconnectCallback(data) {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("Cancel callback: " + JSON.stringify(data));
} }
var subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
}; };
NotificationSubscribe.unsubscribe(subscriber).then(() => { NotificationSubscribe.unsubscribe(subscriber).then(() => {
...@@ -271,6 +281,8 @@ Removes a notification for a specified application. This API uses an asynchronou ...@@ -271,6 +281,8 @@ Removes a notification for a specified application. This API uses an asynchronou
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -289,14 +301,14 @@ function removeCallback(err) { ...@@ -289,14 +301,14 @@ function removeCallback(err) {
console.info("remove success"); console.info("remove success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var notificationKey = { let notificationKey = {
id: 0, id: 0,
label: "label", label: "label",
} };
var reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE; let reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE;
NotificationSubscribe.remove(bundle, notificationKey, reason, removeCallback); NotificationSubscribe.remove(bundle, notificationKey, reason, removeCallback);
``` ```
...@@ -324,6 +336,8 @@ Removes a notification for a specified application. This API uses a promise to r ...@@ -324,6 +336,8 @@ Removes a notification for a specified application. This API uses a promise to r
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -335,14 +349,14 @@ Removes a notification for a specified application. This API uses a promise to r ...@@ -335,14 +349,14 @@ Removes a notification for a specified application. This API uses a promise to r
**Example** **Example**
```js ```js
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
var notificationKey = { let notificationKey = {
id: 0, id: 0,
label: "label", label: "label",
} };
var reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE; let reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE;
NotificationSubscribe.remove(bundle, notificationKey, reason).then(() => { NotificationSubscribe.remove(bundle, notificationKey, reason).then(() => {
console.info("remove success"); console.info("remove success");
}); });
...@@ -372,6 +386,8 @@ Removes a specified notification. This API uses an asynchronous callback to retu ...@@ -372,6 +386,8 @@ Removes a specified notification. This API uses an asynchronous callback to retu
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -382,7 +398,7 @@ Removes a specified notification. This API uses an asynchronous callback to retu ...@@ -382,7 +398,7 @@ Removes a specified notification. This API uses an asynchronous callback to retu
**Example** **Example**
```js ```js
var hashCode = 'hashCode' let hashCode = 'hashCode';
function removeCallback(err) { function removeCallback(err) {
if (err) { if (err) {
...@@ -391,7 +407,7 @@ function removeCallback(err) { ...@@ -391,7 +407,7 @@ function removeCallback(err) {
console.info("remove success"); console.info("remove success");
} }
} }
var reason = NotificationSubscribe.RemoveReason.CANCEL_REASON_REMOVE; let reason = NotificationSubscribe.RemoveReason.CANCEL_REASON_REMOVE;
NotificationSubscribe.remove(hashCode, reason, removeCallback); NotificationSubscribe.remove(hashCode, reason, removeCallback);
``` ```
...@@ -418,6 +434,8 @@ Removes a specified notification. This API uses a promise to return the result. ...@@ -418,6 +434,8 @@ Removes a specified notification. This API uses a promise to return the result.
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -428,8 +446,8 @@ Removes a specified notification. This API uses a promise to return the result. ...@@ -428,8 +446,8 @@ Removes a specified notification. This API uses a promise to return the result.
**Example** **Example**
```js ```js
var hashCode = 'hashCode' let hashCode = 'hashCode';
var reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE; let reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE;
NotificationSubscribe.remove(hashCode, reason).then(() => { NotificationSubscribe.remove(hashCode, reason).then(() => {
console.info("remove success"); console.info("remove success");
}); });
...@@ -458,6 +476,8 @@ Removes all notifications for a specified application. This API uses an asynchro ...@@ -458,6 +476,8 @@ Removes all notifications for a specified application. This API uses an asynchro
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -475,9 +495,9 @@ function removeAllCallback(err) { ...@@ -475,9 +495,9 @@ function removeAllCallback(err) {
console.info("removeAll success"); console.info("removeAll success");
} }
} }
var bundle = { let bundle = {
bundle: "bundleName1", bundle: "bundleName1",
} };
NotificationSubscribe.removeAll(bundle, removeAllCallback); NotificationSubscribe.removeAll(bundle, removeAllCallback);
``` ```
...@@ -503,6 +523,8 @@ Removes all notifications. This API uses an asynchronous callback to return the ...@@ -503,6 +523,8 @@ Removes all notifications. This API uses an asynchronous callback to return the
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -545,6 +567,8 @@ Removes all notifications for a specified application. This API uses a promise t ...@@ -545,6 +567,8 @@ Removes all notifications for a specified application. This API uses a promise t
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -582,6 +606,8 @@ Removes all notifications for a specified user. This API uses an asynchronous ca ...@@ -582,6 +606,8 @@ Removes all notifications for a specified user. This API uses an asynchronous ca
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -600,7 +626,7 @@ function removeAllCallback(err) { ...@@ -600,7 +626,7 @@ function removeAllCallback(err) {
} }
} }
var userId = 1 let userId = 1;
NotificationSubscribe.removeAll(userId, removeAllCallback); NotificationSubscribe.removeAll(userId, removeAllCallback);
``` ```
...@@ -625,6 +651,8 @@ Removes all notifications for a specified user. This API uses a promise to retur ...@@ -625,6 +651,8 @@ Removes all notifications for a specified user. This API uses a promise to retur
**Error codes** **Error codes**
For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md).
| ID| Error Message | | ID| Error Message |
| -------- | ----------------------------------- | | -------- | ----------------------------------- |
| 1600001 | Internal error. | | 1600001 | Internal error. |
...@@ -643,7 +671,7 @@ function removeAllCallback(err) { ...@@ -643,7 +671,7 @@ function removeAllCallback(err) {
} }
} }
var userId = 1 let userId = 1;
NotificationSubscribe.removeAll(userId, removeAllCallback); NotificationSubscribe.removeAll(userId, removeAllCallback);
``` ```
...@@ -689,7 +717,7 @@ function onConsumeCallback(data) { ...@@ -689,7 +717,7 @@ function onConsumeCallback(data) {
console.info('===> onConsume callback req.id:' + req.id); console.info('===> onConsume callback req.id:' + req.id);
}; };
var subscriber = { let subscriber = {
onConsume: onConsumeCallback onConsume: onConsumeCallback
}; };
...@@ -729,7 +757,7 @@ function onCancelCallback(data) { ...@@ -729,7 +757,7 @@ function onCancelCallback(data) {
console.info('===> onCancel callback req.id:' + req.id); console.info('===> onCancel callback req.id:' + req.id);
} }
var subscriber = { let subscriber = {
onCancel: onCancelCallback onCancel: onCancelCallback
}; };
...@@ -767,7 +795,7 @@ function onUpdateCallback(map) { ...@@ -767,7 +795,7 @@ function onUpdateCallback(map) {
console.info('===> onUpdateCallback map:' + JSON.stringify(map)); console.info('===> onUpdateCallback map:' + JSON.stringify(map));
} }
var subscriber = { let subscriber = {
onUpdate: onUpdateCallback onUpdate: onUpdateCallback
}; };
...@@ -799,7 +827,7 @@ function onConnectCallback() { ...@@ -799,7 +827,7 @@ function onConnectCallback() {
console.info('===> onConnect in test'); console.info('===> onConnect in test');
} }
var subscriber = { let subscriber = {
onConnect: onConnectCallback onConnect: onConnectCallback
}; };
...@@ -841,7 +869,7 @@ function onDisconnectCallback() { ...@@ -841,7 +869,7 @@ function onDisconnectCallback() {
console.info('===> onDisconnect in test'); console.info('===> onDisconnect in test');
} }
var subscriber = { let subscriber = {
onConnect: onConnectCallback, onConnect: onConnectCallback,
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
}; };
...@@ -877,7 +905,7 @@ function onDestroyCallback() { ...@@ -877,7 +905,7 @@ function onDestroyCallback() {
console.info('===> onDestroy in test'); console.info('===> onDestroy in test');
} }
var subscriber = { let subscriber = {
onDestroy: onDestroyCallback onDestroy: onDestroyCallback
}; };
...@@ -915,7 +943,7 @@ function onDoNotDisturbDateChangeCallback(mode) { ...@@ -915,7 +943,7 @@ function onDoNotDisturbDateChangeCallback(mode) {
console.info('===> onDoNotDisturbDateChange:' + mode); console.info('===> onDoNotDisturbDateChange:' + mode);
} }
var subscriber = { let subscriber = {
onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback
}; };
...@@ -956,7 +984,7 @@ function onEnabledNotificationChangedCallback(callbackData) { ...@@ -956,7 +984,7 @@ function onEnabledNotificationChangedCallback(callbackData) {
console.info("enable: ", callbackData.enable); console.info("enable: ", callbackData.enable);
}; };
var subscriber = { let subscriber = {
onEnabledNotificationChanged: onEnabledNotificationChangedCallback onEnabledNotificationChanged: onEnabledNotificationChangedCallback
}; };
...@@ -1011,7 +1039,7 @@ NotificationSubscribe.subscribe(subscriber, subscribeCallback); ...@@ -1011,7 +1039,7 @@ NotificationSubscribe.subscribe(subscriber, subscribeCallback);
## NotificationSorting ## NotificationSorting
Provides sorting information of activity notifications. Provides sorting information of active notifications.
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
......
# Notification Error Codes
## 1600001 Internal Error
**Error Message**
Internal error.
**Description**
This error code is reported when an error occurs during internal processing, such as multi-thread processing or internal pointer checks.
**Cause**
Common kernel errors such as multi-thread processing and internal processing errors occur.
**Solution**
Make sure the system resources are sufficient.
## 1600002 Marshalling or Unmarshalling Error
**Error Message**
marshalling or unmarshalling error.
**Description**
This error code is reported when a marshalling or unmarshalling error occurs before data transmission.
**Cause**
A parameter mismatch is detected between the application and the notification service.
**Solution**
Make sure the application SDK version matches the system version.
## 1600003 Failed to Connect to the Notification Service
**Error Message**
Failed to connect service.
**Description**
This error code is reported when the application fails to connect to the notification service.
**Cause**
The notification service is busy or abnormal.
**Solution**
Restart the system.
## 1600004 Notification Disabled
**Error Message**
Notification is not enabled.
**Description**
This error code is reported when notification is disabled.
**Cause**
The notification feature is not enabled for the application.
**Solution**
Enable notification for the application in the notification settings.
## 1600005 Notification Slot Disabled
**Error Message**
Notification slot is not enabled.
**Description**
This error code is reported when the notification slot is not available.
**Cause**
The notification slot is disabled or has not been added.
**Solution**
1. Access the notification settings and check whether the application has the notification slot. If no, add it.
2. Make sure the notification slot is enabled.
## 1600006 Notification Deletion Failed
**Error Message**
Notification is not allowed to remove.
**Description**
This error code is reported when notification deletion is disabled.
**Cause**
The notification attribute **isUnremovable** is set to true.
**Solution**
Set **isUnremovable** as needed. For details, see [NotificationRequest](../apis/js-apis-notificationManager.md#notificationrequest).
## 1600007 Notification Not Found
**Error Message**
The notification is not exist.
**Description**
This error code is reported when the notification service could not find the notification.
**Cause**
The notification has been canceled or deleted.
**Solution**
N/A
## 1600008 User Not Found
**Error Message**
The user is not exist.
**Description**
This error code is reported when the specified user is not found in the information system.
**Cause**
The user information passed is incorrect.
**Solution**
Verify the user information.
## 1600009 Notification Sending Limit Reached
**Error Message**
Over max number notifications per second.
**Description**
This error code is reported when the notification sending frequency reaches the upper limit.
**Cause**
More than 10 notifications are sent per second.
**Solution**
Reduce the notification sending frequency to no more than 10 per second.
## 16000010 Distributed Operation Failed
**Error Message**
Distributed operation failed.
**Description**
This error code is reported when an error occurs with the distributed database operation or distributed API invoking.
**Cause**
The distributed database could not be operated or the distributed API could not be invoked.
**Solution**
Verify the distributed connection.
## 16000011 Failed to Read the Template Configuration
**Error Message**
Read template config failed.
**Description**
This error code is reported when the attempt to read the template configuration file fails.
**Cause**
The template configuration file is lost in the system.
**Solution**
Check for the template configuration file: /system/etc/notification_template/external.json.
## 16000012 Insufficient Memory Space
**Error Message**
No memory space.
**Description**
This error code is reported when a memory allocation error occurs.
**Cause**
A memory allocation error occurs.
**Solution**
Ensure sufficient system memory.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册