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

Update docs (14289)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 459882dd
...@@ -44,6 +44,6 @@ For details about the APIs, see [@ohos.notificationManager](../reference/apis/js ...@@ -44,6 +44,6 @@ For details about the APIs, see [@ohos.notificationManager](../reference/apis/js
notificationManager.requestEnableNotification().then(() => { notificationManager.requestEnableNotification().then(() => {
console.info(`[ANS] requestEnableNotification success`); console.info(`[ANS] requestEnableNotification success`);
}).catch((err) => { }).catch((err) => {
console.error(`[ANS] requestEnableNotification failed, errCode[${err}]`); console.error(`[ANS] requestEnableNotification failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -74,7 +74,7 @@ The major APIs for notification subscription are described as follows. For detai ...@@ -74,7 +74,7 @@ The major APIs for notification subscription are described as follows. For detai
```ts ```ts
notificationSubscribe.subscribe(subscriber, (err, data) => { // This API uses an asynchronous callback to return the result. notificationSubscribe.subscribe(subscriber, (err, data) => { // This API uses an asynchronous callback to return the result.
if (err) { if (err) {
console.error(`[ANS] failed to subscribe, error[${err}]`); console.error(`[ANS] subscribe failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] subscribeTest success : + ${data}`); console.info(`[ANS] subscribeTest success : + ${data}`);
......
...@@ -5,6 +5,7 @@ A [WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md) object encapsu ...@@ -5,6 +5,7 @@ A [WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md) object encapsu
Below you can see the process of adding a **WantAgent** object to a notification. The notification publisher requests a **WantAgent** object from the Ability Manager Service (AMS), and then sends a notification carrying the **WantAgent** object to the home screen. When the user touches the notification from the notification panel on the home screen, the **WantAgent** object is triggered. Below you can see the process of adding a **WantAgent** object to a notification. The notification publisher requests a **WantAgent** object from the Ability Manager Service (AMS), and then sends a notification carrying the **WantAgent** object to the home screen. When the user touches the notification from the notification panel on the home screen, the **WantAgent** object is triggered.
**Figure 1** Publishing a notification with a WantAgent object **Figure 1** Publishing a notification with a WantAgent object
![notification-with-wantagent](figures/notification-with-wantagent.png) ![notification-with-wantagent](figures/notification-with-wantagent.png)
...@@ -14,11 +15,11 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ ...@@ -14,11 +15,11 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/
| Name| Description| | Name| Description|
| -------- | -------- | | -------- | -------- |
| getWantAgent(info: WantAgentInfo, callback: AsyncCallback&lt;WantAgent&gt;): void | Creates a **WantAgent** object.| |getWantAgent(info: WantAgentInfo, callback: AsyncCallback&lt;WantAgent&gt;): void | Creates a **WantAgent** object.|
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback&lt;CompleteData&gt;): void | Triggers a **WantAgent** object.| |trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback&lt;CompleteData&gt;): void | Triggers a **WantAgent** object.|
| cancel(agent: WantAgent, callback: AsyncCallback&lt;void&gt;): void | Cancels a **WantAgent** object.| |cancel(agent: WantAgent, callback: AsyncCallback&lt;void&gt;): void | Cancels a **WantAgent** object.|
| getWant(agent: WantAgent, callback: AsyncCallback&lt;Want&gt;): void | Obtains a **WantAgent** object.| |getWant(agent: WantAgent, callback: AsyncCallback&lt;Want&gt;): void | Obtains a **WantAgent** object.|
| equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback&lt;boolean&gt;): void | Checks whether two **WantAgent** objects are equal. | |equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback&lt;boolean&gt;): void | Checks whether two **WantAgent** objects are equal.|
## How to Develop ## How to Develop
...@@ -95,7 +96,7 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ ...@@ -95,7 +96,7 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/
```typescript ```typescript
// Create a NotificationRequest object. // Create a NotificationRequest object.
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: { normal: {
...@@ -111,7 +112,7 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ ...@@ -111,7 +112,7 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success`); console.info(`[ANS] publish success`);
......
...@@ -5,12 +5,11 @@ The progress notification is a commonly used notification type, mainly used to d ...@@ -5,12 +5,11 @@ The progress notification is a commonly used notification type, mainly used to d
In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#notificationtemplate), which can only be of the progress type, **data** indicates custom template data. In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#notificationtemplate), which can only be of the progress type, **data** indicates custom template data.
## Available APIs ## Available APIs
| Name| Description| | Name| Description|
| -------- | -------- | | -------- | -------- |
| isSupportTemplate(templateName: string, callback: AsyncCallback&lt;boolean&gt;): void | Checks whether a specific template is supported. This API uses an asynchronous callback to return the result.<br>Only the progress-type template is supported.| | isSupportTemplate(templateName: string, callback: AsyncCallback&lt;boolean&gt;): void | Checks whether a specific template is supported. This API uses an asynchronous callback to return the result. For details, see [isSupportTemplate()](../reference/apis/js-apis-notificationManager.md#notificationmanagerissupporttemplate).<br>Only the progress-type template is supported.|
## How to Develop ## How to Develop
...@@ -31,17 +30,18 @@ In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#n ...@@ -31,17 +30,18 @@ In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#n
let isSupportTpl: boolean = data; // The value **true** means that the template of the **downloadTemplate** type is supported; and false means the opposite. let isSupportTpl: boolean = data; // The value **true** means that the template of the **downloadTemplate** type is supported; and false means the opposite.
// ... // ...
}).catch((err) => { }).catch((err) => {
console.error(`[ANS] isSupportTemplate failed, error[${err}]`); console.error(`[ANS] isSupportTemplate failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
> **NOTE** > **NOTE**
> >
> Proceed with the step below only when the specified template is supported. > Proceed with the step below only when the specified template is supported.
4. Create a **NotificationRequest** object and publish a progress notification. 4. Create a **NotificationRequest** object and publish a progress notification.
```ts ```ts
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
...@@ -61,7 +61,7 @@ In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#n ...@@ -61,7 +61,7 @@ In the [NotificationTemplate](../reference/apis/js-apis-notificationManager.md#n
// Publish the notification. // Publish the notification.
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success `); console.info(`[ANS] publish success `);
......
...@@ -45,7 +45,7 @@ The following table describes the APIs for notification publishing. You specify ...@@ -45,7 +45,7 @@ The following table describes the APIs for notification publishing. You specify
- A normal text notification consists of the **title**, **text**, and **additionalText** parameters, of which **title** and **text** are mandatory. The value of these parameters contains less than 200 bytes. - A normal text notification consists of the **title**, **text**, and **additionalText** parameters, of which **title** and **text** are mandatory. The value of these parameters contains less than 200 bytes.
```ts ```ts
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // Basic notification contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // Basic notification
...@@ -59,10 +59,10 @@ The following table describes the APIs for notification publishing. You specify ...@@ -59,10 +59,10 @@ The following table describes the APIs for notification publishing. You specify
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success`); console.info(`[ANS] publish success.`);
}); });
``` ```
...@@ -71,7 +71,7 @@ The following table describes the APIs for notification publishing. You specify ...@@ -71,7 +71,7 @@ The following table describes the APIs for notification publishing. You specify
- In addition to the parameters in the normal text notification, the long text notification provides the **longText**, **briefText**, and **expandedTitle** parameters. The value of **longText** contains a maximum of 1024 bytes, while that of any other parameters contains less than 200 bytes. By default, a long-text notification looks in the same way as a normal text notification. When expanded, the notification displays the title and content specified in **expandedTitle** and **longText**, respectively. - In addition to the parameters in the normal text notification, the long text notification provides the **longText**, **briefText**, and **expandedTitle** parameters. The value of **longText** contains a maximum of 1024 bytes, while that of any other parameters contains less than 200 bytes. By default, a long-text notification looks in the same way as a normal text notification. When expanded, the notification displays the title and content specified in **expandedTitle** and **longText**, respectively.
```ts ```ts
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // Long-text notification contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // Long-text notification
...@@ -89,10 +89,10 @@ The following table describes the APIs for notification publishing. You specify ...@@ -89,10 +89,10 @@ The following table describes the APIs for notification publishing. You specify
// Publish the notification. // Publish the notification.
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success`); console.info(`[ANS] publish success.`);
}); });
``` ```
...@@ -101,7 +101,7 @@ The following table describes the APIs for notification publishing. You specify ...@@ -101,7 +101,7 @@ The following table describes the APIs for notification publishing. You specify
- In addition to the parameters in the normal text notification, the multi-line text notification provides the **lines**, **briefText**, and **longTitle** parameters. The value of these parameters contains less than 200 bytes. By default, a multi-line notification looks in the same way as a normal text notification. When expanded, the notification displays the title and content specified in **longTitle** and **lines**, respectively. - In addition to the parameters in the normal text notification, the multi-line text notification provides the **lines**, **briefText**, and **longTitle** parameters. The value of these parameters contains less than 200 bytes. By default, a multi-line notification looks in the same way as a normal text notification. When expanded, the notification displays the title and content specified in **longTitle** and **lines**, respectively.
```ts ```ts
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // Multi-line text notification contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // Multi-line text notification
...@@ -118,7 +118,7 @@ The following table describes the APIs for notification publishing. You specify ...@@ -118,7 +118,7 @@ The following table describes the APIs for notification publishing. You specify
// Publish the notification. // Publish the notification.
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success`); console.info(`[ANS] publish success`);
...@@ -131,7 +131,7 @@ The following table describes the APIs for notification publishing. You specify ...@@ -131,7 +131,7 @@ The following table describes the APIs for notification publishing. You specify
```ts ```ts
let notificationPicture: PixelMap = undefined; // Obtain the pixel map information. let notificationPicture: PixelMap = undefined; // Obtain the pixel map information.
let notificationRequest = { let notificationRequest: notificationManager.NotificationRequest = {
id: 1, id: 1,
content: { content: {
contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE, contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE,
...@@ -149,10 +149,10 @@ The following table describes the APIs for notification publishing. You specify ...@@ -149,10 +149,10 @@ The following table describes the APIs for notification publishing. You specify
// Publish the notification. // Publish the notification.
notificationManager.publish(notificationRequest, (err) => { notificationManager.publish(notificationRequest, (err) => {
if (err) { if (err) {
console.error(`[ANS] failed to publish, error[${err}]`); console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`);
return; return;
} }
console.info(`[ANS] publish success `); console.info(`[ANS] publish success.`);
}); });
``` ```
......
...@@ -13,12 +13,10 @@ This document gives an overview of the **app.json5** configuration file. To star ...@@ -13,12 +13,10 @@ This document gives an overview of the **app.json5** configuration file. To star
"icon": "$media:app_icon", "icon": "$media:app_icon",
"label": "$string:app_name", "label": "$string:app_name",
"description": "$string:description_application", "description": "$string:description_application",
"distributedNotificationEnabled": true,
"minAPIVersion": 9, "minAPIVersion": 9,
"targetAPIVersion": 9, "targetAPIVersion": 9,
"apiReleaseType": "Release", "apiReleaseType": "Release",
"debug": false, "debug": false,
"entityType": "media",
"car": { "car": {
"minAPIVersion": 8, "minAPIVersion": 8,
} }
...@@ -46,9 +44,8 @@ As shown above, the **app.json5** file contains several tags. ...@@ -46,9 +44,8 @@ As shown above, the **app.json5** file contains several tags.
| minAPIVersion | Minimum API version required for running the application.| Number| Yes (initial value: value of **compatibleSdkVersion** in **build-profile.json5**)| | minAPIVersion | Minimum API version required for running the application.| Number| Yes (initial value: value of **compatibleSdkVersion** in **build-profile.json5**)|
| targetAPIVersion | Target API version required for running the application.| Number| Yes (initial value: value of **compileSdkVersion** in **build-profile.json5**)| | targetAPIVersion | Target API version required for running the application.| Number| Yes (initial value: value of **compileSdkVersion** in **build-profile.json5**)|
| apiReleaseType | Type of the target API version required for running the application. The value can be **"CanaryN"**, **"BetaN"**, or **"Release"**, where **N** represents a positive integer.<br>- **Canary**: indicates a restricted release.<br>- **Beta**: indicates a publicly released beta version.<br>- **Release**: indicates a publicly released official version.<br>The value is set by DevEco Studio reading the stage of the SDK in use.| String| Yes (initial value: set by DevEco Studio)| | apiReleaseType | Type of the target API version required for running the application. The value can be **"CanaryN"**, **"BetaN"**, or **"Release"**, where **N** represents a positive integer.<br>- **Canary**: indicates a restricted release.<br>- **Beta**: indicates a publicly released beta version.<br>- **Release**: indicates a publicly released official version.<br>The value is set by DevEco Studio reading the stage of the SDK in use.| String| Yes (initial value: set by DevEco Studio)|
| distributedNotificationEnabled | Whether distributed notification is enabled for the application. When distributed notification is enabled and device A and device B where the application is installed are on the same distributed network, the devices behave in this way: If device A receives a message, device B will receive a distributed notification prompting the user to check the message received on device A.<br>- **true**: Distributed notification is enabled.<br>- **false**: Distributed notification is not enabled.| Boolean| Yes (initial value: **false**)| | multiProjects | Whether the application supports joint development of multiple projects.<br>- **true**: The application supports joint development of multiple projects.<br>- **false**: The application does not support joint development of multiple projects. For details about multi-project development, see [Multi-Project Build](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/ohos-building-overview-0000001263360495-V3#section71471033104216).| Boolean| Yes (initial value: **false**)|
| entityType | Type of the application. The options are as follows:<br>- game<br>- media<br>- communication<br>- news<br>- travel<br>- utility<br>- shopping<br>- education<br>- kids<br>- business<br>- photography<br>- unspecified| String| Yes (initial value: **"unspecified"**)| | assanEnabled | Whether to enable AddressSanitizer (ASan) to detect memory corruption issues such as buffer overflows.<br>- **true**: ASan is enabled.<br>- **false**: ASan is disabled. Note that ASan is not available in the Release version.| Boolean| Yes (initial value: **false**)|
| multiProjects | Whether the application supports joint development of multiple projects.<br>- **true**: The application supports joint development of multiple projects.<br>- **false**: The application does not support joint development of multiple projects.| Boolean| Yes (initial value: **false**)|
| tablet | Tablet-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on tablets, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)| | tablet | Tablet-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on tablets, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
| tv | TV-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on TVs, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)| | tv | TV-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on TVs, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
| wearable | Wearable-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on wearables, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)| | wearable | Wearable-specific configuration, which includes **minAPIVersion** and **distributedNotificationEnabled** attributes.<br>When running on wearables, the application applies the attribute settings under this tag and ignores the general counterparts.| Object| Yes (initial value: general settings in the **app.json5** file)|
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
The **CommonEvent** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data. The **CommonEvent** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data.
> **NOTE** > **NOTE**
>
> - The APIs provided by this module are no longer maintained since API version 9. You are advised to use [@ohos.commonEventManager](js-apis-commonEventManager.md). > - The APIs provided by this module are no longer maintained since API version 9. You are advised to use [@ohos.commonEventManager](js-apis-commonEventManager.md).
> >
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -43,7 +42,7 @@ Publishes a common event. This API uses an asynchronous callback to return the r ...@@ -43,7 +42,7 @@ Publishes a common event. This API uses an asynchronous callback to return the r
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err.code) { if (err.code) {
console.error("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}`);
} else { } else {
console.info("publish"); console.info("publish");
} }
...@@ -85,7 +84,7 @@ let options = { ...@@ -85,7 +84,7 @@ let options = {
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err.code) { if (err.code) {
console.error("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}`);
} else { } else {
console.info("publish"); console.info("publish");
} }
...@@ -121,7 +120,7 @@ Publishes a common event to a specific user. This API uses an asynchronous callb ...@@ -121,7 +120,7 @@ Publishes a common event to a specific user. This API uses an asynchronous callb
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err.code) { if (err.code) {
console.error("publishAsUser failed " + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}`);
} else { } else {
console.info("publishAsUser"); console.info("publishAsUser");
} }
...@@ -161,14 +160,14 @@ Publishes a common event with given attributes to a specific user. This API uses ...@@ -161,14 +160,14 @@ Publishes a common event with given attributes to a specific user. This API uses
```ts ```ts
// Attributes of a common event. // Attributes of a common event.
let options = { let options = {
code: 0, // Initial code of the common event. code: 0, // Result code of the common event.
data: "initial data";// Initial data of the common event. data: "initial data",// Result data of the common event.
} }
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err.code) { if (err.code) {
console.error("publishAsUser failed " + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}`);
} else { } else {
console.info("publishAsUser"); console.info("publishAsUser");
} }
...@@ -212,7 +211,7 @@ let subscribeInfo = { ...@@ -212,7 +211,7 @@ let subscribeInfo = {
// Callback for subscriber creation. // Callback for subscriber creation.
function createCB(err, commonEventSubscriber) { function createCB(err, commonEventSubscriber) {
if (err.code) { if (err.code) {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber; subscriber = commonEventSubscriber;
...@@ -259,7 +258,7 @@ CommonEvent.createSubscriber(subscribeInfo).then((commonEventSubscriber) => { ...@@ -259,7 +258,7 @@ CommonEvent.createSubscriber(subscribeInfo).then((commonEventSubscriber) => {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber; subscriber = commonEventSubscriber;
}).catch((err) => { }).catch((err) => {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}`);
}); });
``` ```
...@@ -293,7 +292,7 @@ let subscribeInfo = { ...@@ -293,7 +292,7 @@ let subscribeInfo = {
// Callback for common event subscription. // Callback for common event subscription.
function subscribeCB(err, data) { function subscribeCB(err, data) {
if (err.code) { if (err.code) {
console.error("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}`);
} else { } else {
console.info("subscribe " + JSON.stringify(data)); console.info("subscribe " + JSON.stringify(data));
} }
...@@ -302,7 +301,7 @@ function subscribeCB(err, data) { ...@@ -302,7 +301,7 @@ function subscribeCB(err, data) {
// Callback for subscriber creation. // Callback for subscriber creation.
function createCB(err, subscriber) { function createCB(err, subscriber) {
if (err.code) { if (err.code) {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
// Subscribe to a common event. // Subscribe to a common event.
...@@ -344,7 +343,7 @@ let subscribeInfo = { ...@@ -344,7 +343,7 @@ let subscribeInfo = {
// Callback for common event subscription. // Callback for common event subscription.
function subscribeCB(err, data) { function subscribeCB(err, data) {
if (err.code) { if (err.code) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}`);
} else { } else {
console.info("subscribe " + JSON.stringify(data)); console.info("subscribe " + JSON.stringify(data));
} }
...@@ -353,7 +352,7 @@ function subscribeCB(err, data) { ...@@ -353,7 +352,7 @@ function subscribeCB(err, data) {
// Callback for subscriber creation. // Callback for subscriber creation.
function createCB(err, commonEventSubscriber) { function createCB(err, commonEventSubscriber) {
if (err.code) { if (err.code) {
console.info("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber; subscriber = commonEventSubscriber;
...@@ -365,7 +364,7 @@ function createCB(err, commonEventSubscriber) { ...@@ -365,7 +364,7 @@ function createCB(err, commonEventSubscriber) {
// Callback for common event unsubscription. // Callback for common event unsubscription.
function unsubscribeCB(err) { function unsubscribeCB(err) {
if (err.code) { if (err.code) {
console.info("unsubscribe failed " + JSON.stringify(err)); console.error(`unsubscribe failed, code is ${err.code}`);
} else { } else {
console.info("unsubscribe"); console.info("unsubscribe");
} }
...@@ -404,7 +403,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -404,7 +403,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result code obtaining of an ordered common event. // Callback for result code obtaining of an ordered common event.
function getCodeCB(err, Code) { function getCodeCB(err, Code) {
if (err.code) { if (err.code) {
console.error("getCode failed " + JSON.stringify(err)); console.error(`getCode failed, code is ${err.code}`);
} else { } else {
console.info("getCode " + JSON.stringify(Code)); console.info("getCode " + JSON.stringify(Code));
} }
...@@ -436,7 +435,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -436,7 +435,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getCode().then((code) => { subscriber.getCode().then((code) => {
console.info("getCode " + JSON.stringify(code)); console.info("getCode " + JSON.stringify(code));
}).catch((err) => { }).catch((err) => {
console.error("getCode failed " + JSON.stringify(err)); console.error(`getCode failed, code is ${err.code}`);
}); });
``` ```
...@@ -465,7 +464,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -465,7 +464,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result code setting of an ordered common event. // Callback for result code setting of an ordered common event.
function setCodeCB(err) { function setCodeCB(err) {
if (err.code) { if (err.code) {
console.error("setCode failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}`);
} else { } else {
console.info("setCode"); console.info("setCode");
} }
...@@ -503,7 +502,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -503,7 +502,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setCode(1).then(() => { subscriber.setCode(1).then(() => {
console.info("setCode"); console.info("setCode");
}).catch((err) => { }).catch((err) => {
console.error("setCode failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}`);
}); });
``` ```
...@@ -531,7 +530,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -531,7 +530,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result data obtaining of an ordered common event. // Callback for result data obtaining of an ordered common event.
function getDataCB(err, data) { function getDataCB(err, data) {
if (err.code) { if (err.code) {
console.error("getData failed " + JSON.stringify(err)); console.error(`getData failed, code is ${err.code}`);
} else { } else {
console.info("getData " + JSON.stringify(data)); console.info("getData " + JSON.stringify(data));
} }
...@@ -564,7 +563,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -564,7 +563,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getData().then((data) => { subscriber.getData().then((data) => {
console.info("getData " + JSON.stringify(data)); console.info("getData " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.error("getData failed " + JSON.stringify(err)); console.error(`getData failed, code is ${err.code}`);
}); });
``` ```
...@@ -593,7 +592,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -593,7 +592,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result data setting of an ordered common event // Callback for result data setting of an ordered common event
function setDataCB(err) { function setDataCB(err) {
if (err.code) { if (err.code) {
console.error("setData failed " + JSON.stringify(err)); console.error(`sendData failed, code is ${err.code}`);
} else { } else {
console.info("setData"); console.info("setData");
} }
...@@ -631,7 +630,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -631,7 +630,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setData("publish_data_changed").then(() => { subscriber.setData("publish_data_changed").then(() => {
console.info("setData"); console.info("setData");
}).catch((err) => { }).catch((err) => {
console.error("setData failed " + JSON.stringify(err)); console.error(`setData failed, code is ${err.code}`);
}); });
``` ```
...@@ -661,7 +660,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -661,7 +660,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result code and result data setting of an ordered common event. // Callback for result code and result data setting of an ordered common event.
function setCodeDataCB(err) { function setCodeDataCB(err) {
if (err.code) { if (err.code) {
console.error("setCodeAndData failed " + JSON.stringify(err)); console.error(`setCodeAndData failed, code is ${err.code}`);
} else { } else {
console.info("setCodeDataCallback"); console.info("setCodeDataCallback");
} }
...@@ -701,7 +700,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -701,7 +700,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setCodeAndData(1, "publish_data_changed").then(() => { subscriber.setCodeAndData(1, "publish_data_changed").then(() => {
console.info("setCodeAndData"); console.info("setCodeAndData");
}).catch((err) => { }).catch((err) => {
console.info("setCodeAndData failed " + JSON.stringify(err)); console.error(`setCodeAndData failed, code is ${err.code}`);
}); });
``` ```
...@@ -729,7 +728,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -729,7 +728,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is an ordered one. // Callback for checking whether the current common event is an ordered one.
function isOrderedCB(err, isOrdered) { function isOrderedCB(err, isOrdered) {
if (err.code) { if (err.code) {
console.error("isOrderedCommonEvent failed " + JSON.stringify(err)); console.error(`isOrderedCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("isOrdered " + JSON.stringify(isOrdered)); console.info("isOrdered " + JSON.stringify(isOrdered));
} }
...@@ -761,7 +760,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -761,7 +760,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.isOrderedCommonEvent().then((isOrdered) => { subscriber.isOrderedCommonEvent().then((isOrdered) => {
console.info("isOrdered " + JSON.stringify(isOrdered)); console.info("isOrdered " + JSON.stringify(isOrdered));
}).catch((err) => { }).catch((err) => {
console.error("isOrdered failed " + JSON.stringify(err)); console.error(`isOrderedCommonEvent failed, code is ${err.code}`);
}); });
``` ```
...@@ -789,7 +788,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -789,7 +788,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is a sticky one. // Callback for checking whether the current common event is a sticky one.
function isStickyCB(err, isSticky) { function isStickyCB(err, isSticky) {
if (err.code) { if (err.code) {
console.error("isStickyCommonEvent failed " + JSON.stringify(err)); console.error(`isStickyCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("isSticky " + JSON.stringify(isSticky)); console.info("isSticky " + JSON.stringify(isSticky));
} }
...@@ -821,7 +820,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -821,7 +820,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.isStickyCommonEvent().then((isSticky) => { subscriber.isStickyCommonEvent().then((isSticky) => {
console.info("isSticky " + JSON.stringify(isSticky)); console.info("isSticky " + JSON.stringify(isSticky));
}).catch((err) => { }).catch((err) => {
console.error("isSticky failed " + JSON.stringify(err)); console.error(`isSticky failed, code is ${err.code}`);
}); });
``` ```
...@@ -849,7 +848,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -849,7 +848,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for common event aborting. // Callback for common event aborting.
function abortCB(err) { function abortCB(err) {
if (err.code) { if (err.code) {
console.error("abortCommonEvent failed " + JSON.stringify(err)); console.error(`abortCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("abortCommonEvent"); console.info("abortCommonEvent");
} }
...@@ -882,7 +881,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -882,7 +881,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.abortCommonEvent().then(() => { subscriber.abortCommonEvent().then(() => {
console.info("abortCommonEvent"); console.info("abortCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("abortCommonEvent failed " + JSON.stringify(err)); console.error(`abortCommonEvent failed, code is ${err.code}`);
}); });
``` ```
...@@ -910,7 +909,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -910,7 +909,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for clearing the aborted state of the current common event. // Callback for clearing the aborted state of the current common event.
function clearAbortCB(err) { function clearAbortCB(err) {
if (err.code) { if (err.code) {
console.error("clearAbortCommonEvent failed " + JSON.stringify(err)); console.error(`clearAbortCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("clearAbortCommonEvent"); console.info("clearAbortCommonEvent");
} }
...@@ -943,7 +942,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -943,7 +942,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.clearAbortCommonEvent().then(() => { subscriber.clearAbortCommonEvent().then(() => {
console.info("clearAbortCommonEvent"); console.info("clearAbortCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("clearAbortCommonEvent failed " + JSON.stringify(err)); console.error(`clearAbortCommonEvent failed, code is ${err.code}`);
}); });
``` ```
...@@ -971,7 +970,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -971,7 +970,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is in the aborted state. // Callback for checking whether the current common event is in the aborted state.
function getAbortCB(err, abortEvent) { function getAbortCB(err, abortEvent) {
if (err.code) { if (err.code) {
console.error("getAbortCommonEvent failed " + JSON.stringify(err)); console.error(`getAbortCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("abortEvent " + abortEvent) console.info("abortEvent " + abortEvent)
} }
...@@ -1004,7 +1003,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1004,7 +1003,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getAbortCommonEvent().then((abortCommonEvent) => { subscriber.getAbortCommonEvent().then((abortCommonEvent) => {
console.info("abortCommonEvent " + JSON.stringify(abortCommonEvent)); console.info("abortCommonEvent " + JSON.stringify(abortCommonEvent));
}).catch((err) => { }).catch((err) => {
console.error("getAbortCommonEvent failed " + JSON.stringify(err)); console.error(`getAbortCommonEvent failed, code is ${err.code}`);
}); });
``` ```
...@@ -1032,7 +1031,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1032,7 +1031,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for subscriber information obtaining. // Callback for subscriber information obtaining.
function getCB(err, subscribeInfo) { function getCB(err, subscribeInfo) {
if (err.code) { if (err.code) {
console.error("getSubscribeInfo failed " + JSON.stringify(err)); console.error(`getSubscribeInfo failed, code is ${err.code}`);
} else { } else {
console.info("SubscribeInfo " + JSON.stringify(subscribeInfo)); console.info("SubscribeInfo " + JSON.stringify(subscribeInfo));
} }
...@@ -1065,7 +1064,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1065,7 +1064,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getSubscribeInfo().then((subscribeInfo) => { subscriber.getSubscribeInfo().then((subscribeInfo) => {
console.info("subscribeInfo " + JSON.stringify(subscribeInfo)); console.info("subscribeInfo " + JSON.stringify(subscribeInfo));
}).catch((err) => { }).catch((err) => {
console.error("getSubscribeInfo failed " + JSON.stringify(err)); console.error(`getSubscribeInfo failed, code is ${err.code}`);
}); });
``` ```
...@@ -1088,12 +1087,12 @@ Finishes this common event. This API takes effect only for ordered common events ...@@ -1088,12 +1087,12 @@ Finishes this common event. This API takes effect only for ordered common events
**Example** **Example**
```ts ```ts
let subscriber; // Subscriber object successfully created. let subscriber; // Subscriber object successfully created.
// Callback for ordered common event finishing. // Callback for ordered common event finishing.
function finishCB(err) { function finishCB(err) {
if (err.code) { if (err.code) {
console.error("finishCommonEvent failed " + JSON.stringify(err)); console.error(`finishCommonEvent failed, code is ${err.code}`);
} else { } else {
console.info("FinishCommonEvent"); console.info("FinishCommonEvent");
} }
...@@ -1126,7 +1125,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1126,7 +1125,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.finishCommonEvent().then(() => { subscriber.finishCommonEvent().then(() => {
console.info("FinishCommonEvent"); console.info("FinishCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("finishCommonEvent failed " + JSON.stringify(err)); console.error(`finishCommonEvent failed, code is ${err.code}`);
}); });
``` ```
......
...@@ -45,7 +45,7 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco ...@@ -45,7 +45,7 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err) { if (err) {
console.error("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("publish"); console.info("publish");
} }
...@@ -55,7 +55,7 @@ function publishCB(err) { ...@@ -55,7 +55,7 @@ function publishCB(err) {
try { try {
CommonEventManager.publish("event", publishCB); CommonEventManager.publish("event", publishCB);
} catch(err) { } catch(err) {
console.error('publish failed, catch error' + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -94,7 +94,7 @@ let options = { ...@@ -94,7 +94,7 @@ let options = {
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err) { if (err) {
console.error("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("publish"); console.info("publish");
} }
...@@ -104,7 +104,7 @@ function publishCB(err) { ...@@ -104,7 +104,7 @@ function publishCB(err) {
try { try {
CommonEventManager.publish("event", options, publishCB); CommonEventManager.publish("event", options, publishCB);
} catch (err) { } catch (err) {
console.error('publish failed, catch error' + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -138,7 +138,7 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco ...@@ -138,7 +138,7 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco
// Callback for common event publication // Callback for common event publication
function publishCB(err) { function publishCB(err) {
if (err) { if (err) {
console.error("publishAsUser failed " + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("publishAsUser"); console.info("publishAsUser");
} }
...@@ -151,7 +151,7 @@ let userId = 100; ...@@ -151,7 +151,7 @@ let userId = 100;
try { try {
CommonEventManager.publishAsUser("event", userId, publishCB); CommonEventManager.publishAsUser("event", userId, publishCB);
} catch (err) { } catch (err) {
console.error('publishAsUser failed, catch error' + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -193,7 +193,7 @@ let options = { ...@@ -193,7 +193,7 @@ let options = {
// Callback for common event publication. // Callback for common event publication.
function publishCB(err) { function publishCB(err) {
if (err) { if (err) {
console.error("publishAsUser failed " + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("publishAsUser"); console.info("publishAsUser");
} }
...@@ -206,7 +206,7 @@ let userId = 100; ...@@ -206,7 +206,7 @@ let userId = 100;
try { try {
CommonEventManager.publishAsUser("event", userId, options, publishCB); CommonEventManager.publishAsUser("event", userId, options, publishCB);
} catch (err) { } catch (err) {
console.error('publishAsUser failed, catch error' + JSON.stringify(err)); console.error(`publishAsUser failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -244,7 +244,7 @@ function createCB(err, commonEventSubscriber) { ...@@ -244,7 +244,7 @@ function createCB(err, commonEventSubscriber) {
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber; subscriber = commonEventSubscriber;
} else { } else {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} }
} }
...@@ -252,7 +252,7 @@ function createCB(err, commonEventSubscriber) { ...@@ -252,7 +252,7 @@ function createCB(err, commonEventSubscriber) {
try { try {
CommonEventManager.createSubscriber(subscribeInfo, createCB); CommonEventManager.createSubscriber(subscribeInfo, createCB);
} catch (err) { } catch (err) {
console.error('createSubscriber failed, catch error' + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -292,7 +292,7 @@ CommonEventManager.createSubscriber(subscribeInfo).then((commonEventSubscriber) ...@@ -292,7 +292,7 @@ CommonEventManager.createSubscriber(subscribeInfo).then((commonEventSubscriber)
console.info("createSubscriber"); console.info("createSubscriber");
subscriber = commonEventSubscriber; subscriber = commonEventSubscriber;
}).catch((err) => { }).catch((err) => {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -328,7 +328,7 @@ let subscribeInfo = { ...@@ -328,7 +328,7 @@ let subscribeInfo = {
// Callback for common event subscription. // Callback for common event subscription.
function SubscribeCB(err, data) { function SubscribeCB(err, data) {
if (err.code) { if (err.code) {
console.error("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribe "); console.info("subscribe ");
} }
...@@ -342,10 +342,10 @@ function createCB(err, subscriber) { ...@@ -342,10 +342,10 @@ function createCB(err, subscriber) {
try { try {
CommonEventManager.subscribe(subscriber, SubscribeCB); CommonEventManager.subscribe(subscriber, SubscribeCB);
} catch (err) { } catch (err) {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} }
} else { } else {
console.error("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} }
} }
...@@ -353,7 +353,7 @@ function createCB(err, subscriber) { ...@@ -353,7 +353,7 @@ function createCB(err, subscriber) {
try { try {
CommonEventManager.createSubscriber(subscribeInfo, createCB); CommonEventManager.createSubscriber(subscribeInfo, createCB);
} catch (err) { } catch (err) {
console.error('createSubscriber failed, catch error' + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -385,7 +385,7 @@ let subscribeInfo = { ...@@ -385,7 +385,7 @@ let subscribeInfo = {
// Callback for common event subscription. // Callback for common event subscription.
function subscribeCB(err, data) { function subscribeCB(err, data) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribe"); console.info("subscribe");
} }
...@@ -393,21 +393,21 @@ function subscribeCB(err, data) { ...@@ -393,21 +393,21 @@ function subscribeCB(err, data) {
// Callback for subscriber creation. // Callback for subscriber creation.
function createCB(err, subscriber) { function createCB(err, subscriber) {
if (err) { if (err) {
console.info("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("createSubscriber"); console.info("createSubscriber");
// Subscribe to a common event. // Subscribe to a common event.
try { try {
CommonEventManager.subscribe(subscriber, subscribeCB); CommonEventManager.subscribe(subscriber, subscribeCB);
} catch(err) { } catch(err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} }
} }
} }
// Callback for common event unsubscription. // Callback for common event unsubscription.
function unsubscribeCB(err) { function unsubscribeCB(err) {
if (err) { if (err) {
console.info("unsubscribe failed " + JSON.stringify(err)); console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("unsubscribe"); console.info("unsubscribe");
} }
...@@ -416,14 +416,14 @@ function unsubscribeCB(err) { ...@@ -416,14 +416,14 @@ function unsubscribeCB(err) {
try { try {
CommonEventManager.createSubscriber(subscribeInfo, createCB); CommonEventManager.createSubscriber(subscribeInfo, createCB);
} catch (err) { } catch (err) {
console.info("createSubscriber failed " + JSON.stringify(err)); console.error(`createSubscriber failed, code is ${err.code}, message is ${err.message}`);
} }
// Unsubscribe from the common event. // Unsubscribe from the common event.
try { try {
CommonEventManager.unsubscribe(subscriber, unsubscribeCB); CommonEventManager.unsubscribe(subscriber, unsubscribeCB);
} catch (err) { } catch (err) {
console.info("unsubscribe failed " + JSON.stringify(err)); console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`);
} }
``` ```
...@@ -453,7 +453,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -453,7 +453,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for code obtaining of an ordered common event. // Callback for code obtaining of an ordered common event.
function getCodeCB(err, code) { function getCodeCB(err, code) {
if (err.code) { if (err.code) {
console.error("getCode failed " + JSON.stringify(err)); console.error(`getCode failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("getCode " + JSON.stringify(code)); console.info("getCode " + JSON.stringify(code));
} }
...@@ -485,7 +485,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -485,7 +485,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getCode().then((code) => { subscriber.getCode().then((code) => {
console.info("getCode " + JSON.stringify(code)); console.info("getCode " + JSON.stringify(code));
}).catch((err) => { }).catch((err) => {
console.error("getCode failed " + JSON.stringify(err)); console.error(`getCode failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -514,7 +514,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -514,7 +514,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for code setting of an ordered common event. // Callback for code setting of an ordered common event.
function setCodeCB(err) { function setCodeCB(err) {
if (err.code) { if (err.code) {
console.error("setCode failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("setCode"); console.info("setCode");
} }
...@@ -552,7 +552,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -552,7 +552,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setCode(1).then(() => { subscriber.setCode(1).then(() => {
console.info("setCode"); console.info("setCode");
}).catch((err) => { }).catch((err) => {
console.error("setCode failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -580,7 +580,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -580,7 +580,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for data obtaining of an ordered common event. // Callback for data obtaining of an ordered common event.
function getDataCB(err, data) { function getDataCB(err, data) {
if (err.code) { if (err.code) {
console.error("getData failed " + JSON.stringify(err)); console.error(`getData failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("getData " + JSON.stringify(data)); console.info("getData " + JSON.stringify(data));
} }
...@@ -612,7 +612,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -612,7 +612,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getData().then((data) => { subscriber.getData().then((data) => {
console.info("getData " + JSON.stringify(data)); console.info("getData " + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.error("getData failed " + JSON.stringify(err)); console.error(`getData failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -639,7 +639,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -639,7 +639,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for result data setting of an ordered common event // Callback for result data setting of an ordered common event
function setDataCB(err) { function setDataCB(err) {
if (err.code) { if (err.code) {
console.error("setData failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("setData"); console.info("setData");
} }
...@@ -677,7 +677,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -677,7 +677,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setData("publish_data_changed").then(() => { subscriber.setData("publish_data_changed").then(() => {
console.info("setData"); console.info("setData");
}).catch((err) => { }).catch((err) => {
console.error("setData failed " + JSON.stringify(err)); console.error(`setCode failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -707,7 +707,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -707,7 +707,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for code and data setting of an ordered common event. // Callback for code and data setting of an ordered common event.
function setCodeDataCB(err) { function setCodeDataCB(err) {
if (err.code) { if (err.code) {
console.error("setCodeAndData failed " + JSON.stringify(err)); console.error(`setCodeAndData failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("setCodeDataCallback"); console.info("setCodeDataCallback");
} }
...@@ -746,7 +746,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -746,7 +746,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.setCodeAndData(1, "publish_data_changed").then(() => { subscriber.setCodeAndData(1, "publish_data_changed").then(() => {
console.info("setCodeAndData"); console.info("setCodeAndData");
}).catch((err) => { }).catch((err) => {
console.info("setCodeAndData failed " + JSON.stringify(err)); console.error(`setCodeAndData failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -774,7 +774,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -774,7 +774,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is an ordered one. // Callback for checking whether the current common event is an ordered one.
function isOrderedCB(err, isOrdered) { function isOrderedCB(err, isOrdered) {
if (err.code) { if (err.code) {
console.error("isOrderedCommonEvent failed " + JSON.stringify(err)); console.error(`isOrderedCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("isOrdered " + JSON.stringify(isOrdered)); console.info("isOrdered " + JSON.stringify(isOrdered));
} }
...@@ -790,7 +790,7 @@ isOrderedCommonEvent(): Promise<boolean> ...@@ -790,7 +790,7 @@ isOrderedCommonEvent(): Promise<boolean>
Checks whether this common event is an ordered one. This API uses a promise to return the result. Checks whether this common event is an ordered one. This API uses a promise to return the result.
**System capability**: SystemCapability.Notification.CommonEvent **System capability**: SystemCapability.Notification.CommonEvent
**Return value** **Return value**
...@@ -806,7 +806,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -806,7 +806,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.isOrderedCommonEvent().then((isOrdered) => { subscriber.isOrderedCommonEvent().then((isOrdered) => {
console.info("isOrdered " + JSON.stringify(isOrdered)); console.info("isOrdered " + JSON.stringify(isOrdered));
}).catch((err) => { }).catch((err) => {
console.error("isOrdered failed " + JSON.stringify(err)); console.error(`isOrdered failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -816,7 +816,7 @@ subscriber.isOrderedCommonEvent().then((isOrdered) => { ...@@ -816,7 +816,7 @@ subscriber.isOrderedCommonEvent().then((isOrdered) => {
isStickyCommonEvent(callback: AsyncCallback<boolean>): void isStickyCommonEvent(callback: AsyncCallback<boolean>): void
``` ```
Checks whether this common event is a sticky one. This API uses an asynchronous callback to return the result. Checks whether this common event is a sticky one. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Notification.CommonEvent **System capability**: SystemCapability.Notification.CommonEvent
...@@ -834,7 +834,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -834,7 +834,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is a sticky one. // Callback for checking whether the current common event is a sticky one.
function isStickyCB(err, isSticky) { function isStickyCB(err, isSticky) {
if (err.code) { if (err.code) {
console.error("isStickyCommonEvent failed " + JSON.stringify(err)); console.error(`isStickyCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("isSticky " + JSON.stringify(isSticky)); console.info("isSticky " + JSON.stringify(isSticky));
} }
...@@ -866,7 +866,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -866,7 +866,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.isStickyCommonEvent().then((isSticky) => { subscriber.isStickyCommonEvent().then((isSticky) => {
console.info("isSticky " + JSON.stringify(isSticky)); console.info("isSticky " + JSON.stringify(isSticky));
}).catch((err) => { }).catch((err) => {
console.error("isSticky failed " + JSON.stringify(err)); console.error(`isSticky failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -894,7 +894,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -894,7 +894,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for common event aborting. // Callback for common event aborting.
function abortCB(err) { function abortCB(err) {
if (err.code) { if (err.code) {
console.error("abortCommonEvent failed " + JSON.stringify(err)); console.error(`abortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("abortCommonEvent"); console.info("abortCommonEvent");
} }
...@@ -926,7 +926,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -926,7 +926,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.abortCommonEvent().then(() => { subscriber.abortCommonEvent().then(() => {
console.info("abortCommonEvent"); console.info("abortCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("abortCommonEvent failed " + JSON.stringify(err)); console.error(`abortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -954,7 +954,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -954,7 +954,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for clearing the aborted state of the current common event. // Callback for clearing the aborted state of the current common event.
function clearAbortCB(err) { function clearAbortCB(err) {
if (err.code) { if (err.code) {
console.error("clearAbortCommonEvent failed " + JSON.stringify(err)); console.error(`clearAbortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("clearAbortCommonEvent"); console.info("clearAbortCommonEvent");
} }
...@@ -986,7 +986,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -986,7 +986,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.clearAbortCommonEvent().then(() => { subscriber.clearAbortCommonEvent().then(() => {
console.info("clearAbortCommonEvent"); console.info("clearAbortCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("clearAbortCommonEvent failed " + JSON.stringify(err)); console.error(`clearAbortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -1014,7 +1014,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1014,7 +1014,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for checking whether the current common event is in the aborted state. // Callback for checking whether the current common event is in the aborted state.
function getAbortCB(err, abortEvent) { function getAbortCB(err, abortEvent) {
if (err.code) { if (err.code) {
console.error("getAbortCommonEvent failed " + JSON.stringify(err)); console.error(`getAbortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("abortCommonEvent " + abortEvent) console.info("abortCommonEvent " + abortEvent)
} }
...@@ -1046,7 +1046,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1046,7 +1046,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getAbortCommonEvent().then((abortEvent) => { subscriber.getAbortCommonEvent().then((abortEvent) => {
console.info("abortCommonEvent " + JSON.stringify(abortEvent)); console.info("abortCommonEvent " + JSON.stringify(abortEvent));
}).catch((err) => { }).catch((err) => {
console.error("getAbortCommonEvent failed " + JSON.stringify(err)); console.error(`getAbortCommonEvent failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -1074,7 +1074,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1074,7 +1074,7 @@ let subscriber; // Subscriber object successfully created.
// Callback for subscriber information obtaining. // Callback for subscriber information obtaining.
function getCB(err, subscribeInfo) { function getCB(err, subscribeInfo) {
if (err.code) { if (err.code) {
console.error("getSubscribeInfo failed " + JSON.stringify(err)); console.error(`getSubscribeInfo failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeInfo " + JSON.stringify(subscribeInfo)); console.info("subscribeInfo " + JSON.stringify(subscribeInfo));
} }
...@@ -1106,7 +1106,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1106,7 +1106,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.getSubscribeInfo().then((subscribeInfo) => { subscriber.getSubscribeInfo().then((subscribeInfo) => {
console.info("subscribeInfo " + JSON.stringify(subscribeInfo)); console.info("subscribeInfo " + JSON.stringify(subscribeInfo));
}).catch((err) => { }).catch((err) => {
console.error("getSubscribeInfo failed " + JSON.stringify(err)); console.error(`getSubscribeInfo failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
...@@ -1134,11 +1134,11 @@ let subscriber; // Subscriber object successfully created. ...@@ -1134,11 +1134,11 @@ let subscriber; // Subscriber object successfully created.
// Callback for ordered common event finishing. // Callback for ordered common event finishing.
function finishCB(err) { function finishCB(err) {
if (err.code) { if (err.code) {
console.error("finishCommonEvent failed " + JSON.stringify(err)); console.error(`finishCommonEvent failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("FinishCommonEvent"); console.info("FinishCommonEvent");
} }
}
subscriber.finishCommonEvent(finishCB); subscriber.finishCommonEvent(finishCB);
``` ```
...@@ -1166,7 +1166,7 @@ let subscriber; // Subscriber object successfully created. ...@@ -1166,7 +1166,7 @@ let subscriber; // Subscriber object successfully created.
subscriber.finishCommonEvent().then(() => { subscriber.finishCommonEvent().then(() => {
console.info("FinishCommonEvent"); console.info("FinishCommonEvent");
}).catch((err) => { }).catch((err) => {
console.error("finishCommonEvent failed " + JSON.stringify(err)); console.error(`finishCommonEvent failed, code is ${err.code}, message is ${err.message}`);
}); });
``` ```
......
...@@ -35,7 +35,7 @@ Publishes a notification. This API uses an asynchronous callback to return the r ...@@ -35,7 +35,7 @@ Publishes a notification. This API uses an asynchronous callback to return the r
// publish callback // publish callback
function publishCallback(err) { function publishCallback(err) {
if (err.code) { if (err.code) {
console.info("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}`);
} else { } else {
console.info("publish success"); console.info("publish success");
} }
...@@ -55,8 +55,6 @@ let notificationRequest = { ...@@ -55,8 +55,6 @@ let notificationRequest = {
Notification.publish(notificationRequest, publishCallback); Notification.publish(notificationRequest, publishCallback);
``` ```
## Notification.publish ## Notification.publish
publish(request: NotificationRequest): Promise\<void\> publish(request: NotificationRequest): Promise\<void\>
...@@ -118,7 +116,7 @@ Publishes a notification to a specified user. This API uses an asynchronous call ...@@ -118,7 +116,7 @@ Publishes a notification to a specified user. This API uses an asynchronous call
// publish callback // publish callback
function publishCallback(err) { function publishCallback(err) {
if (err.code) { if (err.code) {
console.info("publish failed " + JSON.stringify(err)); console.error(`publish failed, code is ${err.code}`);
} else { } else {
console.info("publish success"); console.info("publish success");
} }
...@@ -298,8 +296,6 @@ function cancelAllCallback(err) { ...@@ -298,8 +296,6 @@ function cancelAllCallback(err) {
Notification.cancelAll(cancelAllCallback); Notification.cancelAll(cancelAllCallback);
``` ```
## Notification.cancelAll ## Notification.cancelAll
cancelAll(): Promise\<void\> cancelAll(): Promise\<void\>
...@@ -316,8 +312,6 @@ Notification.cancelAll().then(() => { ...@@ -316,8 +312,6 @@ Notification.cancelAll().then(() => {
}); });
``` ```
## Notification.addSlot ## Notification.addSlot
addSlot(slot: NotificationSlot, callback: AsyncCallback\<void\>): void addSlot(slot: NotificationSlot, callback: AsyncCallback\<void\>): void
...@@ -355,8 +349,6 @@ let notificationSlot = { ...@@ -355,8 +349,6 @@ let notificationSlot = {
Notification.addSlot(notificationSlot, addSlotCallBack); Notification.addSlot(notificationSlot, addSlotCallBack);
``` ```
## Notification.addSlot ## Notification.addSlot
addSlot(slot: NotificationSlot): Promise\<void\> addSlot(slot: NotificationSlot): Promise\<void\>
...@@ -387,8 +379,6 @@ Notification.addSlot(notificationSlot).then(() => { ...@@ -387,8 +379,6 @@ Notification.addSlot(notificationSlot).then(() => {
}); });
``` ```
## Notification.addSlot ## Notification.addSlot
addSlot(type: SlotType, callback: AsyncCallback\<void\>): void addSlot(type: SlotType, callback: AsyncCallback\<void\>): void
...@@ -418,8 +408,6 @@ function addSlotCallBack(err) { ...@@ -418,8 +408,6 @@ function addSlotCallBack(err) {
Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack); Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack);
``` ```
## Notification.addSlot ## Notification.addSlot
addSlot(type: SlotType): Promise\<void\> addSlot(type: SlotType): Promise\<void\>
...@@ -442,8 +430,6 @@ Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION).then(() => { ...@@ -442,8 +430,6 @@ Notification.addSlot(Notification.SlotType.SOCIAL_COMMUNICATION).then(() => {
}); });
``` ```
## Notification.addSlots ## Notification.addSlots
addSlots(slots: Array\<NotificationSlot\>, callback: AsyncCallback\<void\>): void addSlots(slots: Array\<NotificationSlot\>, callback: AsyncCallback\<void\>): void
...@@ -485,8 +471,6 @@ notificationSlotArray[0] = notificationSlot; ...@@ -485,8 +471,6 @@ notificationSlotArray[0] = notificationSlot;
Notification.addSlots(notificationSlotArray, addSlotsCallBack); Notification.addSlots(notificationSlotArray, addSlotsCallBack);
``` ```
## Notification.addSlots ## Notification.addSlots
addSlots(slots: Array\<NotificationSlot\>): Promise\<void\> addSlots(slots: Array\<NotificationSlot\>): Promise\<void\>
...@@ -521,8 +505,6 @@ Notification.addSlots(notificationSlotArray).then(() => { ...@@ -521,8 +505,6 @@ Notification.addSlots(notificationSlotArray).then(() => {
}); });
``` ```
## Notification.getSlot ## Notification.getSlot
getSlot(slotType: SlotType, callback: AsyncCallback\<NotificationSlot\>): void getSlot(slotType: SlotType, callback: AsyncCallback\<NotificationSlot\>): void
...@@ -553,8 +535,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION; ...@@ -553,8 +535,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.getSlot(slotType, getSlotCallback); Notification.getSlot(slotType, getSlotCallback);
``` ```
## Notification.getSlot ## Notification.getSlot
getSlot(slotType: SlotType): Promise\<NotificationSlot\> getSlot(slotType: SlotType): Promise\<NotificationSlot\>
...@@ -584,8 +564,6 @@ Notification.getSlot(slotType).then((data) => { ...@@ -584,8 +564,6 @@ Notification.getSlot(slotType).then((data) => {
}); });
``` ```
## Notification.getSlots ## Notification.getSlots
getSlots(callback: AsyncCallback<Array\<NotificationSlot\>>): void getSlots(callback: AsyncCallback<Array\<NotificationSlot\>>): void
...@@ -614,8 +592,6 @@ function getSlotsCallback(err, data) { ...@@ -614,8 +592,6 @@ function getSlotsCallback(err, data) {
Notification.getSlots(getSlotsCallback); Notification.getSlots(getSlotsCallback);
``` ```
## Notification.getSlots ## Notification.getSlots
getSlots(): Promise\<Array\<NotificationSlot\>> getSlots(): Promise\<Array\<NotificationSlot\>>
...@@ -638,8 +614,6 @@ Notification.getSlots().then((data) => { ...@@ -638,8 +614,6 @@ Notification.getSlots().then((data) => {
}); });
``` ```
## Notification.removeSlot ## Notification.removeSlot
removeSlot(slotType: SlotType, callback: AsyncCallback\<void\>): void removeSlot(slotType: SlotType, callback: AsyncCallback\<void\>): void
...@@ -670,8 +644,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION; ...@@ -670,8 +644,6 @@ let slotType = Notification.SlotType.SOCIAL_COMMUNICATION;
Notification.removeSlot(slotType,removeSlotCallback); Notification.removeSlot(slotType,removeSlotCallback);
``` ```
## Notification.removeSlot ## Notification.removeSlot
removeSlot(slotType: SlotType): Promise\<void\> removeSlot(slotType: SlotType): Promise\<void\>
...@@ -695,8 +667,6 @@ Notification.removeSlot(slotType).then(() => { ...@@ -695,8 +667,6 @@ Notification.removeSlot(slotType).then(() => {
}); });
``` ```
## Notification.removeAllSlots ## Notification.removeAllSlots
removeAllSlots(callback: AsyncCallback\<void\>): void removeAllSlots(callback: AsyncCallback\<void\>): void
...@@ -724,8 +694,6 @@ function removeAllCallBack(err) { ...@@ -724,8 +694,6 @@ function removeAllCallBack(err) {
Notification.removeAllSlots(removeAllCallBack); Notification.removeAllSlots(removeAllCallBack);
``` ```
## Notification.removeAllSlots ## Notification.removeAllSlots
removeAllSlots(): Promise\<void\> removeAllSlots(): Promise\<void\>
...@@ -742,8 +710,6 @@ Notification.removeAllSlots().then(() => { ...@@ -742,8 +710,6 @@ Notification.removeAllSlots().then(() => {
}); });
``` ```
## Notification.subscribe ## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback\<void\>): void subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback\<void\>): void
...@@ -787,8 +753,6 @@ let info = { ...@@ -787,8 +753,6 @@ let info = {
Notification.subscribe(subscriber, info, subscribeCallback); Notification.subscribe(subscriber, info, subscribeCallback);
``` ```
## Notification.subscribe ## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>): void subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>): void
...@@ -827,8 +791,6 @@ let subscriber = { ...@@ -827,8 +791,6 @@ let subscriber = {
Notification.subscribe(subscriber, subscribeCallback); Notification.subscribe(subscriber, subscribeCallback);
``` ```
## Notification.subscribe ## Notification.subscribe
subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise\<void\> subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise\<void\>
...@@ -862,8 +824,6 @@ Notification.subscribe(subscriber).then(() => { ...@@ -862,8 +824,6 @@ Notification.subscribe(subscriber).then(() => {
}); });
``` ```
## Notification.unsubscribe ## Notification.unsubscribe
unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>): void unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\<void\>): void
...@@ -902,8 +862,6 @@ let subscriber = { ...@@ -902,8 +862,6 @@ let subscriber = {
Notification.unsubscribe(subscriber, unsubscribeCallback); Notification.unsubscribe(subscriber, unsubscribeCallback);
``` ```
## Notification.unsubscribe ## Notification.unsubscribe
unsubscribe(subscriber: NotificationSubscriber): Promise\<void\> unsubscribe(subscriber: NotificationSubscriber): Promise\<void\>
...@@ -936,8 +894,6 @@ Notification.unsubscribe(subscriber).then(() => { ...@@ -936,8 +894,6 @@ Notification.unsubscribe(subscriber).then(() => {
}); });
``` ```
## Notification.enableNotification ## Notification.enableNotification
enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<void\>): void enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<void\>): void
...@@ -974,8 +930,6 @@ let bundle = { ...@@ -974,8 +930,6 @@ let bundle = {
Notification.enableNotification(bundle, false, enableNotificationCallback); Notification.enableNotification(bundle, false, enableNotificationCallback);
``` ```
## Notification.enableNotification ## Notification.enableNotification
enableNotification(bundle: BundleOption, enable: boolean): Promise\<void\> enableNotification(bundle: BundleOption, enable: boolean): Promise\<void\>
...@@ -1006,8 +960,6 @@ Notification.enableNotification(bundle, false).then(() => { ...@@ -1006,8 +960,6 @@ Notification.enableNotification(bundle, false).then(() => {
}); });
``` ```
## Notification.isNotificationEnabled ## Notification.isNotificationEnabled
isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void
...@@ -1043,8 +995,6 @@ let bundle = { ...@@ -1043,8 +995,6 @@ let bundle = {
Notification.isNotificationEnabled(bundle, isNotificationEnabledCallback); Notification.isNotificationEnabled(bundle, isNotificationEnabledCallback);
``` ```
## Notification.isNotificationEnabled ## Notification.isNotificationEnabled
isNotificationEnabled(bundle: BundleOption): Promise\<boolean\> isNotificationEnabled(bundle: BundleOption): Promise\<boolean\>
...@@ -1080,8 +1030,6 @@ Notification.isNotificationEnabled(bundle).then((data) => { ...@@ -1080,8 +1030,6 @@ Notification.isNotificationEnabled(bundle).then((data) => {
}); });
``` ```
## Notification.isNotificationEnabled ## Notification.isNotificationEnabled
isNotificationEnabled(callback: AsyncCallback\<boolean\>): void isNotificationEnabled(callback: AsyncCallback\<boolean\>): void
...@@ -1114,8 +1062,6 @@ function isNotificationEnabledCallback(err, data) { ...@@ -1114,8 +1062,6 @@ function isNotificationEnabledCallback(err, data) {
Notification.isNotificationEnabled(isNotificationEnabledCallback); Notification.isNotificationEnabled(isNotificationEnabledCallback);
``` ```
## Notification.isNotificationEnabled ## Notification.isNotificationEnabled
isNotificationEnabled(): Promise\<boolean\> isNotificationEnabled(): Promise\<boolean\>
...@@ -1148,8 +1094,6 @@ Notification.isNotificationEnabled().then((data) => { ...@@ -1148,8 +1094,6 @@ Notification.isNotificationEnabled().then((data) => {
}); });
``` ```
## Notification.displayBadge ## Notification.displayBadge
displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<void\>): void displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<void\>): void
...@@ -1186,8 +1130,6 @@ let bundle = { ...@@ -1186,8 +1130,6 @@ let bundle = {
Notification.displayBadge(bundle, false, displayBadgeCallback); Notification.displayBadge(bundle, false, displayBadgeCallback);
``` ```
## Notification.displayBadge ## Notification.displayBadge
displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\> displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\>
...@@ -1218,8 +1160,6 @@ Notification.displayBadge(bundle, false).then(() => { ...@@ -1218,8 +1160,6 @@ Notification.displayBadge(bundle, false).then(() => {
}); });
``` ```
## Notification.isBadgeDisplayed ## Notification.isBadgeDisplayed
isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void
...@@ -1255,8 +1195,6 @@ let bundle = { ...@@ -1255,8 +1195,6 @@ let bundle = {
Notification.isBadgeDisplayed(bundle, isBadgeDisplayedCallback); Notification.isBadgeDisplayed(bundle, isBadgeDisplayedCallback);
``` ```
## Notification.isBadgeDisplayed ## Notification.isBadgeDisplayed
isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\> isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\>
...@@ -1292,8 +1230,6 @@ Notification.isBadgeDisplayed(bundle).then((data) => { ...@@ -1292,8 +1230,6 @@ Notification.isBadgeDisplayed(bundle).then((data) => {
}); });
``` ```
## Notification.setSlotByBundle ## Notification.setSlotByBundle
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback\<void\>): void setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback\<void\>): void
...@@ -1333,8 +1269,6 @@ let notificationSlot = { ...@@ -1333,8 +1269,6 @@ let notificationSlot = {
Notification.setSlotByBundle(bundle, notificationSlot, setSlotByBundleCallback); Notification.setSlotByBundle(bundle, notificationSlot, setSlotByBundleCallback);
``` ```
## Notification.setSlotByBundle ## Notification.setSlotByBundle
setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\> setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\>
...@@ -1368,8 +1302,6 @@ Notification.setSlotByBundle(bundle, notificationSlot).then(() => { ...@@ -1368,8 +1302,6 @@ Notification.setSlotByBundle(bundle, notificationSlot).then(() => {
}); });
``` ```
## Notification.getSlotsByBundle ## Notification.getSlotsByBundle
getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<NotificationSlot\>>): void getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<NotificationSlot\>>): void
...@@ -1405,8 +1337,6 @@ let bundle = { ...@@ -1405,8 +1337,6 @@ let bundle = {
Notification.getSlotsByBundle(bundle, getSlotsByBundleCallback); Notification.getSlotsByBundle(bundle, getSlotsByBundleCallback);
``` ```
## Notification.getSlotsByBundle ## Notification.getSlotsByBundle
getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>> getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>>
...@@ -1442,8 +1372,6 @@ Notification.getSlotsByBundle(bundle).then((data) => { ...@@ -1442,8 +1372,6 @@ Notification.getSlotsByBundle(bundle).then((data) => {
}); });
``` ```
## Notification.getSlotNumByBundle ## Notification.getSlotNumByBundle
getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): void getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): void
...@@ -1479,8 +1407,6 @@ let bundle = { ...@@ -1479,8 +1407,6 @@ let bundle = {
Notification.getSlotNumByBundle(bundle, getSlotNumByBundleCallback); Notification.getSlotNumByBundle(bundle, getSlotNumByBundleCallback);
``` ```
## Notification.getSlotNumByBundle ## Notification.getSlotNumByBundle
getSlotNumByBundle(bundle: BundleOption): Promise\<number\> getSlotNumByBundle(bundle: BundleOption): Promise\<number\>
...@@ -1516,8 +1442,6 @@ Notification.getSlotNumByBundle(bundle).then((data) => { ...@@ -1516,8 +1442,6 @@ Notification.getSlotNumByBundle(bundle).then((data) => {
}); });
``` ```
## Notification.remove ## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback\<void\>): void remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback\<void\>): void
...@@ -1560,8 +1484,6 @@ let reason = Notification.RemoveReason.CLICK_REASON_REMOVE; ...@@ -1560,8 +1484,6 @@ let reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
Notification.remove(bundle, notificationKey, reason, removeCallback); Notification.remove(bundle, notificationKey, reason, removeCallback);
``` ```
## Notification.remove ## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise\<void\> remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise\<void\>
...@@ -1598,8 +1520,6 @@ Notification.remove(bundle, notificationKey, reason).then(() => { ...@@ -1598,8 +1520,6 @@ Notification.remove(bundle, notificationKey, reason).then(() => {
}); });
``` ```
## Notification.remove ## Notification.remove
remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback\<void\>): void remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback\<void\>): void
...@@ -1636,8 +1556,6 @@ let reason = Notification.RemoveReason.CANCEL_REASON_REMOVE; ...@@ -1636,8 +1556,6 @@ let reason = Notification.RemoveReason.CANCEL_REASON_REMOVE;
Notification.remove(hashCode, reason, removeCallback); Notification.remove(hashCode, reason, removeCallback);
``` ```
## Notification.remove ## Notification.remove
remove(hashCode: string, reason: RemoveReason): Promise\<void\> remove(hashCode: string, reason: RemoveReason): Promise\<void\>
...@@ -1667,8 +1585,6 @@ Notification.remove(hashCode, reason).then(() => { ...@@ -1667,8 +1585,6 @@ Notification.remove(hashCode, reason).then(() => {
}); });
``` ```
## Notification.removeAll ## Notification.removeAll
removeAll(bundle: BundleOption, callback: AsyncCallback\<void\>): void removeAll(bundle: BundleOption, callback: AsyncCallback\<void\>): void
...@@ -1704,8 +1620,6 @@ let bundle = { ...@@ -1704,8 +1620,6 @@ let bundle = {
Notification.removeAll(bundle, removeAllCallback); Notification.removeAll(bundle, removeAllCallback);
``` ```
## Notification.removeAll ## Notification.removeAll
removeAll(callback: AsyncCallback\<void\>): void removeAll(callback: AsyncCallback\<void\>): void
...@@ -1738,8 +1652,6 @@ function removeAllCallback(err) { ...@@ -1738,8 +1652,6 @@ function removeAllCallback(err) {
Notification.removeAll(removeAllCallback); Notification.removeAll(removeAllCallback);
``` ```
## Notification.removeAll ## Notification.removeAll
removeAll(bundle?: BundleOption): Promise\<void\> removeAll(bundle?: BundleOption): Promise\<void\>
...@@ -1861,8 +1773,6 @@ function getAllActiveNotificationsCallback(err, data) { ...@@ -1861,8 +1773,6 @@ function getAllActiveNotificationsCallback(err, data) {
Notification.getAllActiveNotifications(getAllActiveNotificationsCallback); Notification.getAllActiveNotifications(getAllActiveNotificationsCallback);
``` ```
## Notification.getAllActiveNotifications ## Notification.getAllActiveNotifications
getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\>
...@@ -1889,8 +1799,6 @@ Notification.getAllActiveNotifications().then((data) => { ...@@ -1889,8 +1799,6 @@ Notification.getAllActiveNotifications().then((data) => {
}); });
``` ```
## Notification.getActiveNotificationCount ## Notification.getActiveNotificationCount
getActiveNotificationCount(callback: AsyncCallback\<number\>): void getActiveNotificationCount(callback: AsyncCallback\<number\>): void
...@@ -1919,8 +1827,6 @@ function getActiveNotificationCountCallback(err, data) { ...@@ -1919,8 +1827,6 @@ function getActiveNotificationCountCallback(err, data) {
Notification.getActiveNotificationCount(getActiveNotificationCountCallback); Notification.getActiveNotificationCount(getActiveNotificationCountCallback);
``` ```
## Notification.getActiveNotificationCount ## Notification.getActiveNotificationCount
getActiveNotificationCount(): Promise\<number\> getActiveNotificationCount(): Promise\<number\>
...@@ -1943,8 +1849,6 @@ Notification.getActiveNotificationCount().then((data) => { ...@@ -1943,8 +1849,6 @@ Notification.getActiveNotificationCount().then((data) => {
}); });
``` ```
## Notification.getActiveNotifications ## Notification.getActiveNotifications
getActiveNotifications(callback: AsyncCallback<Array\<NotificationRequest\>>): void getActiveNotifications(callback: AsyncCallback<Array\<NotificationRequest\>>): void
...@@ -1973,8 +1877,6 @@ function getActiveNotificationsCallback(err, data) { ...@@ -1973,8 +1877,6 @@ function getActiveNotificationsCallback(err, data) {
Notification.getActiveNotifications(getActiveNotificationsCallback); Notification.getActiveNotifications(getActiveNotificationsCallback);
``` ```
## Notification.getActiveNotifications ## Notification.getActiveNotifications
getActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> getActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\>
...@@ -1997,8 +1899,6 @@ Notification.getActiveNotifications().then((data) => { ...@@ -1997,8 +1899,6 @@ Notification.getActiveNotifications().then((data) => {
}); });
``` ```
## Notification.cancelGroup<sup>8+</sup> ## Notification.cancelGroup<sup>8+</sup>
cancelGroup(groupName: string, callback: AsyncCallback\<void\>): void cancelGroup(groupName: string, callback: AsyncCallback\<void\>): void
...@@ -2030,8 +1930,6 @@ let groupName = "GroupName"; ...@@ -2030,8 +1930,6 @@ let groupName = "GroupName";
Notification.cancelGroup(groupName, cancelGroupCallback); Notification.cancelGroup(groupName, cancelGroupCallback);
``` ```
## Notification.cancelGroup<sup>8+</sup> ## Notification.cancelGroup<sup>8+</sup>
cancelGroup(groupName: string): Promise\<void\> cancelGroup(groupName: string): Promise\<void\>
...@@ -2055,8 +1953,6 @@ Notification.cancelGroup(groupName).then(() => { ...@@ -2055,8 +1953,6 @@ Notification.cancelGroup(groupName).then(() => {
}); });
``` ```
## Notification.removeGroupByBundle<sup>8+</sup> ## Notification.removeGroupByBundle<sup>8+</sup>
removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback\<void\>): void removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback\<void\>): void
...@@ -2094,8 +1990,6 @@ let groupName = "GroupName"; ...@@ -2094,8 +1990,6 @@ let groupName = "GroupName";
Notification.removeGroupByBundle(bundleOption, groupName, removeGroupByBundleCallback); Notification.removeGroupByBundle(bundleOption, groupName, removeGroupByBundleCallback);
``` ```
## Notification.removeGroupByBundle<sup>8+</sup> ## Notification.removeGroupByBundle<sup>8+</sup>
removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\> removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\>
...@@ -2125,8 +2019,6 @@ Notification.removeGroupByBundle(bundleOption, groupName).then(() => { ...@@ -2125,8 +2019,6 @@ Notification.removeGroupByBundle(bundleOption, groupName).then(() => {
}); });
``` ```
## Notification.setDoNotDisturbDate<sup>8+</sup> ## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback\<void\>): void setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback\<void\>): void
...@@ -2166,8 +2058,6 @@ let doNotDisturbDate = { ...@@ -2166,8 +2058,6 @@ let doNotDisturbDate = {
Notification.setDoNotDisturbDate(doNotDisturbDate, setDoNotDisturbDateCallback); Notification.setDoNotDisturbDate(doNotDisturbDate, setDoNotDisturbDateCallback);
``` ```
## Notification.setDoNotDisturbDate<sup>8+</sup> ## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate): Promise\<void\> setDoNotDisturbDate(date: DoNotDisturbDate): Promise\<void\>
...@@ -2241,8 +2131,6 @@ let userId = 1 ...@@ -2241,8 +2131,6 @@ let userId = 1
Notification.setDoNotDisturbDate(doNotDisturbDate, userId, setDoNotDisturbDateCallback); Notification.setDoNotDisturbDate(doNotDisturbDate, userId, setDoNotDisturbDateCallback);
``` ```
## Notification.setDoNotDisturbDate<sup>8+</sup> ## Notification.setDoNotDisturbDate<sup>8+</sup>
setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise\<void\> setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise\<void\>
...@@ -2311,8 +2199,6 @@ function getDoNotDisturbDateCallback(err, data) { ...@@ -2311,8 +2199,6 @@ function getDoNotDisturbDateCallback(err, data) {
Notification.getDoNotDisturbDate(getDoNotDisturbDateCallback); Notification.getDoNotDisturbDate(getDoNotDisturbDateCallback);
``` ```
## Notification.getDoNotDisturbDate<sup>8+</sup> ## Notification.getDoNotDisturbDate<sup>8+</sup>
getDoNotDisturbDate(): Promise\<DoNotDisturbDate\> getDoNotDisturbDate(): Promise\<DoNotDisturbDate\>
...@@ -2375,8 +2261,6 @@ let userId = 1; ...@@ -2375,8 +2261,6 @@ let userId = 1;
Notification.getDoNotDisturbDate(userId, getDoNotDisturbDateCallback); Notification.getDoNotDisturbDate(userId, getDoNotDisturbDateCallback);
``` ```
## Notification.getDoNotDisturbDate<sup>8+</sup> ## Notification.getDoNotDisturbDate<sup>8+</sup>
getDoNotDisturbDate(userId: number): Promise\<DoNotDisturbDate\> getDoNotDisturbDate(userId: number): Promise\<DoNotDisturbDate\>
...@@ -2444,8 +2328,6 @@ function supportDoNotDisturbModeCallback(err,data) { ...@@ -2444,8 +2328,6 @@ function supportDoNotDisturbModeCallback(err,data) {
Notification.supportDoNotDisturbMode(supportDoNotDisturbModeCallback); Notification.supportDoNotDisturbMode(supportDoNotDisturbModeCallback);
``` ```
## Notification.supportDoNotDisturbMode<sup>8+</sup> ## Notification.supportDoNotDisturbMode<sup>8+</sup>
supportDoNotDisturbMode(): Promise\<boolean\> supportDoNotDisturbMode(): Promise\<boolean\>
...@@ -2472,8 +2354,6 @@ Notification.supportDoNotDisturbMode().then((data) => { ...@@ -2472,8 +2354,6 @@ Notification.supportDoNotDisturbMode().then((data) => {
}); });
``` ```
## Notification.isSupportTemplate<sup>8+</sup> ## Notification.isSupportTemplate<sup>8+</sup>
isSupportTemplate(templateName: string, callback: AsyncCallback\<boolean\>): void isSupportTemplate(templateName: string, callback: AsyncCallback\<boolean\>): void
...@@ -2504,8 +2384,6 @@ function isSupportTemplateCallback(err, data) { ...@@ -2504,8 +2384,6 @@ function isSupportTemplateCallback(err, data) {
Notification.isSupportTemplate(templateName, isSupportTemplateCallback); Notification.isSupportTemplate(templateName, isSupportTemplateCallback);
``` ```
## Notification.isSupportTemplate<sup>8+</sup> ## Notification.isSupportTemplate<sup>8+</sup>
isSupportTemplate(templateName: string): Promise\<boolean\> isSupportTemplate(templateName: string): Promise\<boolean\>
...@@ -2536,8 +2414,6 @@ Notification.isSupportTemplate(templateName).then((data) => { ...@@ -2536,8 +2414,6 @@ Notification.isSupportTemplate(templateName).then((data) => {
}); });
``` ```
## Notification.requestEnableNotification<sup>8+</sup> ## Notification.requestEnableNotification<sup>8+</sup>
requestEnableNotification(callback: AsyncCallback\<void\>): void requestEnableNotification(callback: AsyncCallback\<void\>): void
...@@ -2566,8 +2442,6 @@ function requestEnableNotificationCallback(err) { ...@@ -2566,8 +2442,6 @@ function requestEnableNotificationCallback(err) {
Notification.requestEnableNotification(requestEnableNotificationCallback); Notification.requestEnableNotification(requestEnableNotificationCallback);
``` ```
## Notification.requestEnableNotification<sup>8+</sup> ## Notification.requestEnableNotification<sup>8+</sup>
requestEnableNotification(): Promise\<void\> requestEnableNotification(): Promise\<void\>
...@@ -2620,8 +2494,6 @@ let enable = true; ...@@ -2620,8 +2494,6 @@ let enable = true;
Notification.enableDistributed(enable, enabledNotificationCallback); Notification.enableDistributed(enable, enabledNotificationCallback);
``` ```
## Notification.enableDistributed<sup>8+</sup> ## Notification.enableDistributed<sup>8+</sup>
enableDistributed(enable: boolean): Promise\<void> enableDistributed(enable: boolean): Promise\<void>
...@@ -2678,8 +2550,6 @@ function isDistributedEnabledCallback(err, data) { ...@@ -2678,8 +2550,6 @@ function isDistributedEnabledCallback(err, data) {
Notification.isDistributedEnabled(isDistributedEnabledCallback); Notification.isDistributedEnabled(isDistributedEnabledCallback);
``` ```
## Notification.isDistributedEnabled<sup>8+</sup> ## Notification.isDistributedEnabled<sup>8+</sup>
isDistributedEnabled(): Promise\<boolean> isDistributedEnabled(): Promise\<boolean>
...@@ -2743,8 +2613,6 @@ let enable = true; ...@@ -2743,8 +2613,6 @@ let enable = true;
Notification.enableDistributedByBundle(bundle, enable, enableDistributedByBundleCallback); Notification.enableDistributedByBundle(bundle, enable, enableDistributedByBundleCallback);
``` ```
## Notification.enableDistributedByBundle<sup>8+</sup> ## Notification.enableDistributedByBundle<sup>8+</sup>
enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise\<void> enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise\<void>
...@@ -2814,8 +2682,6 @@ let bundle = { ...@@ -2814,8 +2682,6 @@ let bundle = {
Notification.isDistributedEnabledByBundle(bundle, isDistributedEnabledByBundleCallback); Notification.isDistributedEnabledByBundle(bundle, isDistributedEnabledByBundleCallback);
``` ```
## Notification.isDistributedEnabledByBundle<sup>8+</sup> ## Notification.isDistributedEnabledByBundle<sup>8+</sup>
isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean> isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean>
...@@ -2885,8 +2751,6 @@ function getDeviceRemindTypeCallback(err,data) { ...@@ -2885,8 +2751,6 @@ function getDeviceRemindTypeCallback(err,data) {
Notification.getDeviceRemindType(getDeviceRemindTypeCallback); Notification.getDeviceRemindType(getDeviceRemindTypeCallback);
``` ```
## Notification.getDeviceRemindType<sup>8+</sup> ## Notification.getDeviceRemindType<sup>8+</sup>
getDeviceRemindType(): Promise\<DeviceRemindType\> getDeviceRemindType(): Promise\<DeviceRemindType\>
...@@ -3381,8 +3245,6 @@ Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => { ...@@ -3381,8 +3245,6 @@ Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => {
}); });
``` ```
## NotificationSubscriber ## NotificationSubscriber
Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](#notificationsubscribe). Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](#notificationsubscribe).
...@@ -3797,8 +3659,6 @@ Notification.enableNotification(bundle, false).then(() => { ...@@ -3797,8 +3659,6 @@ Notification.enableNotification(bundle, false).then(() => {
| bundle | string | Yes | Yes | Bundle information of the application.| | bundle | string | Yes | Yes | Bundle information of the application.|
| uid | number | Yes | Yes | User ID.| | uid | number | Yes | Yes | User ID.|
## NotificationKey ## NotificationKey
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
......
...@@ -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. |
...@@ -48,7 +50,7 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -48,7 +50,7 @@ Subscribes to a notification with the subscription information specified. This A
// subscribe callback // subscribe callback
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribe success"); console.info("subscribe success");
} }
...@@ -86,6 +88,8 @@ Subscribes to notifications of all applications under this user. This API uses a ...@@ -86,6 +88,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. |
...@@ -97,7 +101,7 @@ Subscribes to notifications of all applications under this user. This API uses a ...@@ -97,7 +101,7 @@ Subscribes to notifications of all applications under this user. This API uses a
```js ```js
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribe success"); console.info("subscribe success");
} }
...@@ -134,6 +138,8 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -134,6 +138,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. |
...@@ -177,6 +183,8 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu ...@@ -177,6 +183,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. |
...@@ -188,7 +196,7 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu ...@@ -188,7 +196,7 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu
```js ```js
function unsubscribeCallback(err) { function unsubscribeCallback(err) {
if (err) { if (err) {
console.info("unsubscribe failed " + JSON.stringify(err)); console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("unsubscribe success"); console.info("unsubscribe success");
} }
...@@ -222,6 +230,8 @@ Unsubscribes from a notification. This API uses a promise to return the result. ...@@ -222,6 +230,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. |
...@@ -265,6 +275,8 @@ Removes a notification for a specified application. This API uses an asynchronou ...@@ -265,6 +275,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. |
...@@ -278,7 +290,7 @@ Removes a notification for a specified application. This API uses an asynchronou ...@@ -278,7 +290,7 @@ Removes a notification for a specified application. This API uses an asynchronou
```js ```js
function removeCallback(err) { function removeCallback(err) {
if (err) { if (err) {
console.info("remove failed " + JSON.stringify(err)); console.error(`remove failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("remove success"); console.info("remove success");
} }
...@@ -318,6 +330,8 @@ Removes a notification for a specified application. This API uses a promise to r ...@@ -318,6 +330,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. |
...@@ -364,6 +378,8 @@ Removes a specified notification. This API uses an asynchronous callback to retu ...@@ -364,6 +378,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. |
...@@ -378,7 +394,7 @@ let hashCode = 'hashCode'; ...@@ -378,7 +394,7 @@ let hashCode = 'hashCode';
function removeCallback(err) { function removeCallback(err) {
if (err) { if (err) {
console.info("remove failed " + JSON.stringify(err)); console.error(`remove failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("remove success"); console.info("remove success");
} }
...@@ -408,6 +424,8 @@ Removes a specified notification. This API uses a promise to return the result. ...@@ -408,6 +424,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. |
...@@ -446,6 +464,8 @@ Removes all notifications for a specified application. This API uses an asynchro ...@@ -446,6 +464,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. |
...@@ -458,7 +478,7 @@ Removes all notifications for a specified application. This API uses an asynchro ...@@ -458,7 +478,7 @@ Removes all notifications for a specified application. This API uses an asynchro
```js ```js
function removeAllCallback(err) { function removeAllCallback(err) {
if (err) { if (err) {
console.info("removeAll failed " + JSON.stringify(err)); console.error(`removeAll failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("removeAll success"); console.info("removeAll success");
} }
...@@ -489,6 +509,8 @@ Removes all notifications. This API uses an asynchronous callback to return the ...@@ -489,6 +509,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. |
...@@ -500,7 +522,7 @@ Removes all notifications. This API uses an asynchronous callback to return the ...@@ -500,7 +522,7 @@ Removes all notifications. This API uses an asynchronous callback to return the
```js ```js
function removeAllCallback(err) { function removeAllCallback(err) {
if (err) { if (err) {
console.info("removeAll failed " + JSON.stringify(err)); console.error(`removeAll failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("removeAll success"); console.info("removeAll success");
} }
...@@ -529,6 +551,8 @@ Removes all notifications for a specified application. This API uses a promise t ...@@ -529,6 +551,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. |
...@@ -566,6 +590,8 @@ Removes all notifications for a specified user. This API uses an asynchronous ca ...@@ -566,6 +590,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. |
...@@ -578,7 +604,7 @@ Removes all notifications for a specified user. This API uses an asynchronous ca ...@@ -578,7 +604,7 @@ Removes all notifications for a specified user. This API uses an asynchronous ca
```js ```js
function removeAllCallback(err) { function removeAllCallback(err) {
if (err) { if (err) {
console.info("removeAll failed " + JSON.stringify(err)); console.error(`removeAll failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("removeAll success"); console.info("removeAll success");
} }
...@@ -609,6 +635,8 @@ Removes all notifications for a specified user. This API uses a promise to retur ...@@ -609,6 +635,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. |
...@@ -621,7 +649,7 @@ Removes all notifications for a specified user. This API uses a promise to retur ...@@ -621,7 +649,7 @@ Removes all notifications for a specified user. This API uses a promise to retur
```js ```js
function removeAllCallback(err) { function removeAllCallback(err) {
if (err) { if (err) {
console.info("removeAll failed " + JSON.stringify(err)); console.error(`removeAll failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("removeAll success"); console.info("removeAll success");
} }
...@@ -659,7 +687,7 @@ Callback for receiving notifications. ...@@ -659,7 +687,7 @@ Callback for receiving notifications.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -699,7 +727,7 @@ Callback for canceling notifications. ...@@ -699,7 +727,7 @@ Callback for canceling notifications.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -739,7 +767,7 @@ Callback for notification sorting updates. ...@@ -739,7 +767,7 @@ Callback for notification sorting updates.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -771,7 +799,7 @@ Callback for subscription. ...@@ -771,7 +799,7 @@ Callback for subscription.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -803,14 +831,14 @@ Callback for unsubscription. ...@@ -803,14 +831,14 @@ Callback for unsubscription.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
}; };
function unsubscribeCallback(err) { function unsubscribeCallback(err) {
if (err.code) { if (err.code) {
console.info("unsubscribe failed " + JSON.stringify(err)); console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("unsubscribeCallback"); console.info("unsubscribeCallback");
} }
...@@ -849,7 +877,7 @@ Callback for service disconnection. ...@@ -849,7 +877,7 @@ Callback for service disconnection.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -887,7 +915,7 @@ Callback for DND time setting updates. ...@@ -887,7 +915,7 @@ Callback for DND time setting updates.
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -926,7 +954,7 @@ Listens for the notification enabled status changes. This API uses an asynchrono ...@@ -926,7 +954,7 @@ Listens for the notification enabled status changes. This API uses an asynchrono
```javascript ```javascript
function subscribeCallback(err) { function subscribeCallback(err) {
if (err) { if (err) {
console.info("subscribe failed " + JSON.stringify(err)); console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
console.info("subscribeCallback"); console.info("subscribeCallback");
} }
...@@ -945,6 +973,46 @@ let subscriber = { ...@@ -945,6 +973,46 @@ let subscriber = {
notificationSubscribe.subscribe(subscriber, subscribeCallback); notificationSubscribe.subscribe(subscriber, subscribeCallback);
``` ```
### onBadgeChanged<sup>10+</sup>
onBadgeChanged?:(data: [BadgeNumberCallbackData](#badgenumbercallbackdata)) => void
Listens for the change of the notification badge number.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------- |
| callback | AsyncCallback\<[BadgeNumberCallbackData](#badgenumbercallbackdata)\> | Yes | Callback used to return the result.|
**Example**
```javascript
function subscribeCallback(err) {
if (err) {
console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else {
console.info("subscribeCallback");
}
};
function onBadgeChangedCallback(data) {
console.info("bundle: ", data.bundle);
console.info("uid: ", data.uid);
console.info("badgeNumber: ", data.badgeNumber);
};
let subscriber = {
onBadgeChanged: onBadgeChangedCallback
};
notificationSubscribe.subscribe(subscriber, subscribeCallback);
```
## BundleOption ## BundleOption
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
...@@ -1054,3 +1122,15 @@ Provides the notification user input. ...@@ -1054,3 +1122,15 @@ Provides the notification user input.
| -------------------- | --- | -------------------- | | -------------------- | --- | -------------------- |
| CLICK_REASON_REMOVE | 1 | The notification is removed after a click on it. | | CLICK_REASON_REMOVE | 1 | The notification is removed after a click on it. |
| CANCEL_REASON_REMOVE | 2 | The notification is removed by the user. | | CANCEL_REASON_REMOVE | 2 | The notification is removed by the user. |
## BadgeNumberCallbackData<sup>10+</sup>
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| ----------- | ------ | ---- | ---- | ------------ |
| bundle | string | Yes | No | Bundle name of the application.|
| uid | number | Yes | No | UID of the application. |
| badgeNumber | number | Yes | No | Notification badge number. |
# 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.
先完成此消息的编辑!
想要评论请 注册