From 44c19094e28873186f48c09a3d70641b55e7713a Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Mon, 29 Aug 2022 13:37:34 +0800 Subject: [PATCH] update docs (8657) Signed-off-by: ester.zhou --- .../reference/apis/js-apis-commonEvent.md | 192 ++-- .../reference/apis/js-apis-notification.md | 842 +++++++++--------- 2 files changed, 528 insertions(+), 506 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-commonEvent.md b/en/application-dev/reference/apis/js-apis-commonEvent.md index d0702995d7..710d6ccb88 100644 --- a/en/application-dev/reference/apis/js-apis-commonEvent.md +++ b/en/application-dev/reference/apis/js-apis-commonEvent.md @@ -2,7 +2,7 @@ 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 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. @@ -18,7 +18,7 @@ Provides the event types supported by the **CommonEvent** module. The name and v **System capability**: SystemCapability.Notification.CommonEvent -| Name | Value | Subscriber Permissions | Description | +| Name | Value | Subscriber Permission | Description | | ------------ | ------------------ | ---------------------- | -------------------- | | COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded. | | COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the user has finished booting and the system has been loaded but the screen is still locked. | @@ -30,7 +30,7 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_POWER_DISCONNECTED | usual.event.POWER_DISCONNECTED | - | Indicates the common event that the device is disconnected from the external power supply. | | COMMON_EVENT_SCREEN_OFF | usual.event.SCREEN_OFF | - | Indicates the common event that the device screen is off and the device is sleeping. | | COMMON_EVENT_SCREEN_ON | usual.event.SCREEN_ON | - | Indicates the common event that the device screen is on and the device is in interactive state. | -| COMMON_EVENT_THERMAL_LEVEL_CHANGED8+ | usual.event.THERMAL_LEVEL_CHANGED | - | Indicates the common event that the device's thermal level has changed. | +| COMMON_EVENT_THERMAL_LEVEL_CHANGED8+ | usual.event.THERMAL_LEVEL_CHANGED | - | Indicates the common event that the device's thermal level has changed. | | COMMON_EVENT_USER_PRESENT | usual.event.USER_PRESENT | - | Indicates the common event that the user unlocks the device. | | COMMON_EVENT_TIME_TICK | usual.event.TIME_TICK | - | Indicates the common event that the system time has changed. | | COMMON_EVENT_TIME_CHANGED | usual.event.TIME_CHANGED | - | Indicates the common event that the system time is set. | @@ -39,7 +39,7 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_CLOSE_SYSTEM_DIALOGS | usual.event.CLOSE_SYSTEM_DIALOGS | - | Indicates the common event that a user closes a temporary system dialog box. | | COMMON_EVENT_PACKAGE_ADDED | usual.event.PACKAGE_ADDED | - | Indicates the common event that a new application package has been installed on the device. | | COMMON_EVENT_PACKAGE_REPLACED | usual.event.PACKAGE_REPLACED | - | Indicates the common event that a later version of an installed application package has replaced the previous one on the device. | -| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | - | Indicates the common event that a later version of your application package has replaced the previous one. | +| COMMON_EVENT_MY_PACKAGE_REPLACED | usual.event.MY_PACKAGE_REPLACED | - | Indicates the common event that a later version of your application package has replaced the previous one. | COMMON_EVENT_PACKAGE_REMOVED | usual.event.PACKAGE_REMOVED | - | Indicates the common event that an installed application has been uninstalled from the device with the application data retained. | | COMMON_EVENT_BUNDLE_REMOVED | usual.event.BUNDLE_REMOVED | - | Indicates the common event that an installed bundle has been uninstalled from the device with the application data retained. | | COMMON_EVENT_PACKAGE_FULLY_REMOVED | usual.event.PACKAGE_FULLY_REMOVED | - | Indicates the common event that an installed application, including both the application data and code, has been completely uninstalled from the device. | @@ -66,21 +66,21 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_USER_STARTED | usual.event.USER_STARTED | - | Indicates the common event that the user has been started. | | COMMON_EVENT_USER_BACKGROUND | usual.event.USER_BACKGROUND | - | Indicates the common event that the user has been brought to the background. | | COMMON_EVENT_USER_FOREGROUND | usual.event.USER_FOREGROUND | - | Indicates the common event that the user has been brought to the foreground. | -| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_USERS | Indicates the common event that user switching is happening. | -| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be started. | +| COMMON_EVENT_USER_SWITCHED | usual.event.USER_SWITCHED | ohos.permission.MANAGE_USERS | Indicates the common event that user switching is happening. | +| COMMON_EVENT_USER_STARTING | usual.event.USER_STARTING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be started. | | COMMON_EVENT_USER_UNLOCKED | usual.event.USER_UNLOCKED | - | Indicates the common event that the credential-encrypted storage has been unlocked for the current user when the device is unlocked after being restarted. | -| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be stopped. | +| COMMON_EVENT_USER_STOPPING | usual.event.USER_STOPPING | ohos.permission.INTERACT_ACROSS_USERS | Indicates the common event that the user is going to be stopped. | | COMMON_EVENT_USER_STOPPED | usual.event.USER_STOPPED | - | Indicates the common event that the user has been stopped. | | COMMON_EVENT_HWID_LOGIN | common.event.HWID_LOGIN | - | Indicates the common event about a HUAWEI ID login. | | COMMON_EVENT_HWID_LOGOUT | common.event.HWID_LOGOUT | - | Indicates the common event about a HUAWEI ID logout. | | COMMON_EVENT_HWID_TOKEN_INVALID | common.event.HWID_TOKEN_INVALID | - | Indicates the common event that the HUAWEI ID is invalid. | | COMMON_EVENT_HWID_LOGOFF | common.event.HWID_LOGOFF | - | Indicates the common event about a HUAWEI ID logoff. | | COMMON_EVENT_WIFI_POWER_STATE | usual.event.wifi.POWER_STATE | - | Indicates the common event about the Wi-Fi network state, such as enabled and disabled. | -| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | Indicates the common event that the Wi-Fi access point has been scanned and proven to be available. | -| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi signal strength (RSSI) has changed. | +| COMMON_EVENT_WIFI_SCAN_FINISHED | usual.event.wifi.SCAN_FINISHED | ohos.permission.LOCATION | Indicates the common event that the Wi-Fi access point has been scanned and proven to be available. | +| COMMON_EVENT_WIFI_RSSI_VALUE | usual.event.wifi.RSSI_VALUE | ohos.permission.GET_WIFI_INFO | Indicates the common event that the Wi-Fi signal strength (RSSI) has changed. | | COMMON_EVENT_WIFI_CONN_STATE | usual.event.wifi.CONN_STATE | - | Indicates the common event that the Wi-Fi connection state has changed. | | COMMON_EVENT_WIFI_HOTSPOT_STATE | usual.event.wifi.HOTSPOT_STATE | - | Indicates the common event about the Wi-Fi hotspot state, such as enabled or disabled. | -| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO | Indicates the common event that a client has joined the Wi-Fi hotspot of the current device. | +| COMMON_EVENT_WIFI_AP_STA_JOIN | usual.event.wifi.WIFI_HS_STA_JOIN | ohos.permission.GET_WIFI_INFO | Indicates the common event that a client has joined the Wi-Fi hotspot of the current device. | | COMMON_EVENT_WIFI_AP_STA_LEAVE | usual.event.wifi.WIFI_HS_STA_LEAVE | ohos.permission.GET_WIFI_INFO |Indicates the common event that a client has disconnected from the Wi-Fi hotspot of the current device. | | COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE | usual.event.wifi.mplink.STATE_CHANGE | ohos.permission.MPLINK_CHANGE_STATE | Indicates the common event that the state of MPLINK (an enhanced Wi-Fi feature) has changed. | | COMMON_EVENT_WIFI_P2P_CONN_STATE | usual.event.wifi.p2p.CONN_STATE_CHANGE | ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION | Indicates the common event that the Wi-Fi P2P connection state has changed. | @@ -104,7 +104,7 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE | usual.event.bluetooth.remotedevice.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the friendly name of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. | | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE | usual.event.bluetooth.remotedevice.PAIR_STATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of a remote Bluetooth device has changed. | | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE | usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the battery level of a remote Bluetooth device is retrieved for the first time or is changed since the last retrieval. | -| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | - | Indicates the common event about the SDP state of a remote Bluetooth device. | +| COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT | usual.event.bluetooth.remotedevice.SDP_RESULT | - | Indicates the common event about the SDP state of a remote Bluetooth device. | | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE | usual.event.bluetooth.remotedevice.UUID_VALUE | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the UUID connection state of a remote Bluetooth device. | | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ | usual.event.bluetooth.remotedevice.PAIRING_REQ | ohos.permission.DISCOVER_BLUETOOTH | Indicates the common event about the pairing request from a remote Bluetooth device. | | COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL | usual.event.bluetooth.remotedevice.PAIRING_CANCEL | - | Indicates the common event that Bluetooth pairing is canceled. | @@ -115,29 +115,29 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE | - | Indicates the common event that the audio state of a Bluetooth handsfree has changed. | | COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT | usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT | - | Indicates the common event that the audio gateway state of a Bluetooth handsfree has changed. | | COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE | usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE | - | Indicates the common event that the calling state of a Bluetooth handsfree has changed. | -| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the state of a Bluetooth adapter has been changed, for example, Bluetooth has been enabled or disabled. | +| COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE | usual.event.bluetooth.host.STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the state of a Bluetooth adapter has been changed, for example, Bluetooth has been enabled or disabled. | | COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE | usual.event.bluetooth.host.REQ_DISCOVERABLE | - | Indicates the common event about the request for the user to allow Bluetooth device scanning. | -| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to enable Bluetooth. | -| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to disable Bluetooth. | -| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning mode of a device has changed. | -| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning has been started on the device. | -| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning is finished on the device. | -| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth adapter name of the device has changed. | -| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP Sink has changed. | -| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP Sink has changed. | -| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio state of Bluetooth A2DP Sink has changed. | +| COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE | usual.event.bluetooth.host.REQ_ENABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to enable Bluetooth. | +| COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE | usual.event.bluetooth.host.REQ_DISABLE | ohos.permission.USE_BLUETOOTH | Indicates the common event about the request for the user to disable Bluetooth. | +| COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE | usual.event.bluetooth.host.SCAN_MODE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning mode of a device has changed. | +| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED | usual.event.bluetooth.host.DISCOVERY_STARTED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning has been started on the device. | +| COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED | usual.event.bluetooth.host.DISCOVERY_FINISHED | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth scanning is finished on the device. | +| COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE | usual.event.bluetooth.host.NAME_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the Bluetooth adapter name of the device has changed. | +| COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE | usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the connection state of Bluetooth A2DP Sink has changed. | +| COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE | usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the playing state of Bluetooth A2DP Sink has changed. | +| COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE | usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE | ohos.permission.USE_BLUETOOTH | Indicates the common event that the audio state of Bluetooth A2DP Sink has changed. | | COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED | usual.event.nfc.action.ADAPTER_STATE_CHANGED | - | Indicates the common event that the state of the device's NFC adapter has changed. | -| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the enabled state. | -| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the disabled state. | +| COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED | usual.event.nfc.action.RF_FIELD_ON_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the enabled state. | +| COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED | usual.event.nfc.action.RF_FIELD_OFF_DETECTED | ohos.permission.MANAGE_SECURE_SETTINGS | Indicates the common event that the NFC RF field is detected to be in the disabled state. | | COMMON_EVENT_DISCHARGING | usual.event.DISCHARGING | - | Indicates the common event that the system stops charging the battery. | | COMMON_EVENT_CHARGING | usual.event.CHARGING | - | Indicates the common event that the system starts charging the battery. | | COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED | usual.event.DEVICE_IDLE_MODE_CHANGED | - | Indicates the common event that the system idle mode has changed. | | COMMON_EVENT_POWER_SAVE_MODE_CHANGED | usual.event.POWER_SAVE_MODE_CHANGED | - | Indicates the common event that the power saving mode of the system has changed. | -| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been added to the system. | -| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been removed from the system. | -| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been added. | -| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been removed. | -| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been updated. | +| COMMON_EVENT_USER_ADDED | usual.event.USER_ADDED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been added to the system. | +| COMMON_EVENT_USER_REMOVED | usual.event.USER_REMOVED | ohos.permission.MANAGE_USERS | Indicates the common event that a user has been removed from the system. | +| COMMON_EVENT_ABILITY_ADDED | usual.event.ABILITY_ADDED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been added. | +| COMMON_EVENT_ABILITY_REMOVED | usual.event.ABILITY_REMOVED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been removed. | +| COMMON_EVENT_ABILITY_UPDATED | usual.event.ABILITY_UPDATED | ohos.permission.LISTEN_BUNDLE_CHANGE | Indicates the common event that an ability has been updated. | | COMMON_EVENT_LOCATION_MODE_STATE_CHANGED | usual.event.location.MODE_STATE_CHANGED | - | Indicates the common event that the location mode of the system has changed. | | COMMON_EVENT_IVI_SLEEP | common.event.IVI_SLEEP | - | Indicates the common event that the in-vehicle infotainment (IVI) system of a vehicle is sleeping. | | COMMON_EVENT_IVI_PAUSE | common.event.IVI_PAUSE | - | Indicates the common event that the IVI system of a vehicle has entered sleep mode and the playing application is instructed to stop playback. | @@ -153,7 +153,7 @@ Provides the event types supported by the **CommonEvent** module. The name and v |COMMON_EVENT_USB_STATE9+ | usual.event.hardware.usb.action.USB_STATE | - | Indicates the common event that the USB device status has changed. | |COMMON_EVENT_USB_PORT_CHANGED9+ | usual.event.hardware.usb.action.USB_PORT_CHANGED | - | Indicates the common event that the USB port status of the user device has changed. | | COMMON_EVENT_USB_DEVICE_ATTACHED | usual.event.hardware.usb.action.USB_DEVICE_ATTACHED | - | Indicates the common event that a USB device has been attached when the user device functions as a USB host. | -| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | - | Indicates the common event that a USB device has been detached when the user device functions as a USB host. | +| COMMON_EVENT_USB_DEVICE_DETACHED | usual.event.hardware.usb.action.USB_DEVICE_DETACHED | - | Indicates the common event that a USB device has been detached when the user device functions as a USB host. | | COMMON_EVENT_USB_ACCESSORY_ATTACHED | usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED | - | Indicates the common event that a USB accessory was attached. | | COMMON_EVENT_USB_ACCESSORY_DETACHED | usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED | - | Indicates the common event that a USB accessory was detached. | | COMMON_EVENT_DISK_REMOVED | usual.event.data.DISK_REMOVED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed. | @@ -162,18 +162,18 @@ Provides the event types supported by the **CommonEvent** module. The name and v | COMMON_EVENT_DISK_BAD_REMOVAL | usual.event.data.DISK_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed without being unmounted. | | COMMON_EVENT_DISK_UNMOUNTABLE | usual.event.data.DISK_UNMOUNTABLE | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device becomes unmountable. | | COMMON_EVENT_DISK_EJECT | usual.event.data.DISK_EJECT | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was ejected. | -| COMMON_EVENT_VOLUME_REMOVED9+ | usual.event.data.VOLUME_REMOVED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed. | -| COMMON_EVENT_VOLUME_UNMOUNTED9+ | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was unmounted. | -| COMMON_EVENT_VOLUME_MOUNTED9+ | usual.event.data.VOLUME_MOUNTED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was mounted. | -| COMMON_EVENT_VOLUME_BAD_REMOVAL9+ | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed without being unmounted. | -| COMMON_EVENT_VOLUME_EJECT9+ | usual.event.data.VOLUME_EJECT | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was ejected. | +| COMMON_EVENT_VOLUME_REMOVED9+ | usual.event.data.VOLUME_REMOVED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed. | +| COMMON_EVENT_VOLUME_UNMOUNTED9+ | usual.event.data.VOLUME_UNMOUNTED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was unmounted. | +| COMMON_EVENT_VOLUME_MOUNTED9+ | usual.event.data.VOLUME_MOUNTED | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was mounted. | +| COMMON_EVENT_VOLUME_BAD_REMOVAL9+ | usual.event.data.VOLUME_BAD_REMOVAL | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was removed without being unmounted. | +| COMMON_EVENT_VOLUME_EJECT9+ | usual.event.data.VOLUME_EJECT | ohos.permission.WRITE_USER_STORAGE or ohos.permission.READ_USER_STORAGE| Indicates the common event that an external storage device was ejected. | | COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED | usual.event.data.VISIBLE_ACCOUNTS_UPDATED | ohos.permission.GET_APP_ACCOUNTS | Indicates the common event that the account visibility changed. | | COMMON_EVENT_ACCOUNT_DELETED | usual.event.data.ACCOUNT_DELETED | ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | Indicates the common event that the account was deleted. | | COMMON_EVENT_FOUNDATION_READY | usual.event.data.FOUNDATION_READY | ohos.permission.RECEIVER_STARTUP_COMPLETED | Indicates the common event that the foundation is ready. | -| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | - | Indicates the common event that the airplane mode of the device has changed. | -| COMMON_EVENT_SPLIT_SCREEN8+ | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | Indicates the common event of screen splitting. | -| COMMON_EVENT_SLOT_CHANGE9+ | usual.event.SLOT_CHANGE | ohos.permission.NOTIFICATION_CONTROLLER | Indicates the common event that the notification slot has changed. | -| COMMON_EVENT_SPN_INFO_CHANGED9+ | usual.event.SPN_INFO_CHANGED | - | Indicates the common event that the SPN displayed has been updated. | +| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | - | Indicates the common event that the airplane mode of the device has changed. | +| COMMON_EVENT_SPLIT_SCREEN8+ | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | Indicates the common event of screen splitting. | +| COMMON_EVENT_SLOT_CHANGE9+ | usual.event.SLOT_CHANGE | ohos.permission.NOTIFICATION_CONTROLLER | Indicates the common event that the notification slot has changed. | +| COMMON_EVENT_SPN_INFO_CHANGED 9+ | usual.event.SPN_INFO_CHANGED | - | Indicates the common event that the SPN displayed has been updated. | ## CommonEvent.publish @@ -186,10 +186,10 @@ Publishes a common event. This API uses a callback to return the result. **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| -------- | -------- | -------------------- | ---- | ---------------------- | -| event | Read only | string | Yes | Name of the common event to publish.| -| callback | Read only | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------------- | +| event | string | Yes | Name of the common event to publish.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -219,11 +219,11 @@ Publishes a common event with given attributes. This API uses a callback to retu **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| -------- | -------- | ---------------------- | ---- | ---------------------- | -| event | Read only | string | Yes | Name of the common event to publish. | -| options | Read only | [CommonEventPublishData](#commoneventpublishdata) | Yes | Attributes of the common event to publish.| -| callback | Read only | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | ---------------------- | +| event | string | Yes | Name of the common event to publish. | +| options | [CommonEventPublishData](#commoneventpublishdata) | Yes | Attributes of the common event to publish.| +| callback | syncCallback\ | Yes | Callback used to return the result. | **Example** @@ -263,11 +263,11 @@ Publishes a common event to a specific user. This API uses a callback to return **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| -------- | -------- | -------------------- | ---- | ---------------------------------- | -| event | Read only | string | Yes | Name of the common event to publish. | -| userId | Read only | number | Yes | User ID.| -| callback | Read only | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------------------------- | +| event | string | Yes | Name of the common event to publish. | +| userId | number | Yes | User ID.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -302,12 +302,12 @@ Publishes a common event with given attributes to a specific user. This API uses **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| -------- | -------- | ---------------------- | ---- | ---------------------- | -| event | Read only | string | Yes | Name of the common event to publish. | -| userId | Read only| number | Yes| User ID.| -| options | Read only | [CommonEventPublishData](#commoneventpublishdata) | Yes | Attributes of the common event to publish.| -| callback | Read only | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | ---------------------- | +| event | string | Yes | Name of the common event to publish. | +| userId | number | Yes| User ID.| +| options | [CommonEventPublishData](#commoneventpublishdata) | Yes | Attributes of the common event to publish.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -347,10 +347,10 @@ Creates a subscriber. This API uses a callback to return the result. **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| ------------- | -------- | ------------------------------------------------------------ | ---- | -------------------------- | -| subscribeInfo | Read only | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | Yes | Subscriber information. | -| callback | Read only | AsyncCallback\<[CommonEventSubscriber](#commoneventsubscriber)> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ------------- | ------------------------------------------------------------ | ---- | -------------------------- | +| subscribeInfo | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | Yes | Subscriber information. | +| callback | AsyncCallback\<[CommonEventSubscriber](#commoneventsubscriber)> | Yes | Callback used to return the result.| **Example** @@ -389,9 +389,9 @@ Creates a subscriber. This API uses a promise to return the result. **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| ------------- | -------- | ----------------------------------------------------- | ---- | -------------- | -| subscribeInfo | Read only | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | Yes | Subscriber information.| +| Name | Type | Mandatory| Description | +| ------------- | ----------------------------------------------------- | ---- | -------------- | +| subscribeInfo | [CommonEventSubscribeInfo](#commoneventsubscribeinfo) | Yes | Subscriber information.| **Return value** | Type | Description | @@ -429,10 +429,10 @@ Subscribes to common events. This API uses a callback to return the result. **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| ---------- | -------- | --------------------------------------------------- | ---- | -------------------------------- | -| subscriber | Read only | [CommonEventSubscriber](#commoneventsubscriber) | Yes | Subscriber object. | -| callback | Read only | AsyncCallback\<[CommonEventData](#commoneventdata)> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ---------- | ---------------------------------------------------- | ---- | -------------------------------- | +| subscriber | [CommonEventSubscriber](#commoneventsubscriber) | Yes | Subscriber object. | +| callback | AsyncCallback\<[CommonEventData](#commoneventdata)> | Yes | Callback used to return the result.| **Example** @@ -481,10 +481,10 @@ Unsubscribes from common events. This API uses a callback to return the result. **Parameters** -| Name | Readable/Writable| Type | Mandatory| Description | -| ---------- | -------- | ----------------------------------------------- | ---- | ------------------------ | -| subscriber | Read only | [CommonEventSubscriber](#commoneventsubscriber) | Yes | Subscriber object. | -| callback | Read only | AsyncCallback\ | No | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ---------- | ----------------------------------------------- | ---- | ------------------------ | +| subscriber | [CommonEventSubscriber](#commoneventsubscriber) | Yes | Subscriber object. | +| callback | AsyncCallback\ | No | Callback used to return the result.| **Example** @@ -1234,37 +1234,37 @@ subscriber.finishCommonEvent().then(() => { **System capability**: SystemCapability.Notification.CommonEvent -| Name | Readable/Writable| Type | Mandatory| Description | -| ---------- | -------- | -------------------- | ---- | ------------------------------------------------------- | -| event | Read only | string | Yes | Name of the common event that is being received. | -| bundleName | Read only | string | No | Bundle name. | -| code | Read only | number | No | Result code of the common event, which is used to transfer data of the int type. | -| data | Read only | string | No | Custom result data of the common event, which is used to transfer data of the string type.| -| parameters | Read only | {[key: string]: any} | No | Additional information about the common event. | +| Name | Readable| Writable| Type | Description | +| ---------- | ---- | ---- | -------------------- | ------------------------------------------------------- | +| event | Yes | No | string | Name of the common event that is being received. | +| bundleName | Yes | No | string | Bundle name. | +| code | Yes | No | number | Result code of the common event, which is used to transfer data of the int type. | +| data | Yes | No | string | Custom result data of the common event, which is used to transfer data of the string type.| +| parameters | Yes | No | {[key: string]: any} | Additional information about the common event. | ## CommonEventPublishData **System capability**: SystemCapability.Notification.CommonEvent -| Name | Readable/Writable| Type | Mandatory| Description | -| --------------------- | -------- | -------------------- | ---- | ---------------------------- | -| bundleName | Read only | string | No | Bundle name. | -| code | Read only | number | No | Result code of the common event. | -| data | Read only | string | No | Custom result data of the common event.| -| subscriberPermissions | Read only | Array\ | No | Permissions required for subscribers to receive the common event. | -| isOrdered | Read only | boolean | No | Whether the common event is an ordered one. | -| isSticky | Read only | boolean | No | Whether the common event is a sticky one. | -| parameters | Read only | {[key: string]: any} | No | Additional information about the common event. | +| Name | Readable| Writable| Type | Description | +| --------------------- | ---- | ---- | -------------------- | ---------------------------- | +| bundleName | Yes | No | string | Bundle name. | +| code | Yes | No | number | Result code of the common event. | +| data | Yes | No | string | Custom result data of the common event.| +| subscriberPermissions | Yes | No | Array\ | Permissions required for subscribers to receive the common event. | +| isOrdered | Yes | No | boolean | Whether the common event is an ordered one. | +| isSticky | Yes | No | boolean | Whether the common event is a sticky one. | +| parameters | Yes | No | {[key: string]: any} | Additional information about the common event. | ## CommonEventSubscribeInfo **System capability**: SystemCapability.Notification.CommonEvent -| Name | Readable/Writable| Type | Mandatory| Description | -| ------------------- | -------- | -------------- | ---- | ------------------------------------------------------------ | -| events | Read only | Array\ | Yes | Name of the common event to publish. | -| publisherPermission | Read only | string | No | Permissions required for publishers to publish the common event. | -| publisherDeviceId | Read only | string | No | Device ID. The value must be the ID of an existing device on the same network. | -| userId | Read only | number | No | User ID. The default value is the ID of the current user. If this parameter is specified, the value must be an existing user ID in the system.| -| priority | Read only | number | No | Subscriber priority. The value ranges from -100 to 1000. | +| Name | Readable| Writable| Type | Description | +| ------------------- | ---- | ---- | -------------- | ------------------------------------------------------------ | +| events | Yes | No | Array\ | Name of the common event to publish. | +| publisherPermission | Yes | No | string | Permissions required for publishers to publish the common event. | +| publisherDeviceId | Yes | No | string | Device ID. The value must be the ID of an existing device on the same network. | +| userId | Yes | No | number | User ID. The default value is the ID of the current user. If this parameter is specified, the value must be an existing user ID in the system.| +| priority | Yes | No | number | Subscriber priority. The value ranges from -100 to 1000. | diff --git a/en/application-dev/reference/apis/js-apis-notification.md b/en/application-dev/reference/apis/js-apis-notification.md index 1e9fa33963..2f6cd9a66d 100644 --- a/en/application-dev/reference/apis/js-apis-notification.md +++ b/en/application-dev/reference/apis/js-apis-notification.md @@ -4,7 +4,7 @@ The **Notification** module provides notification management capabilities, cover Generally, only system applications have the permission to subscribe to and unsubscribe from notifications. -> **NOTE**
+> **NOTE** > > 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. @@ -24,10 +24,10 @@ Publishes a notification. This API uses an asynchronous callback to return the r **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | ---- | ------------------------------------------- | ---- | ------------------------------------------- | -| request | Yes | No |[NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| -| callback | Yes | No |AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------- | ---- | ------------------------------------------- | +| request | [NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -61,6 +61,12 @@ Publishes a notification. This API uses a promise to return the result. **System capability**: SystemCapability.Notification.Notification +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------- | ---- | ------------------------------------------- | +| request | [NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| + **Example** ```js @@ -96,11 +102,11 @@ Publishes a notification. This API uses an asynchronous callback to return the r **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | ---- | ----------------------------------------- | ---- | ------------------------------------------- | -| request | Yes | No |[NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| -| userId | Yes | No |number | Yes | ID of the user who receives the notification. | -| callback | Yes | No |AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ----------------------------------------- | ---- | ------------------------------------------- | +| request | [NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| +| userId | number | Yes | ID of the user who receives the notification. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -140,10 +146,10 @@ Publishes a notification. This API uses a promise to return the result. **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | ---- | ----------------------------------------- | ---- | ------------------------------------------- | -| request | Yes | No |[NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| -| userId | Yes | No |number | Yes | ID of the user who receives the notification. | +| Name | Type | Mandatory| Description | +| -------- | ----------------------------------------- | ---- | ------------------------------------------- | +| request | [NotificationRequest](#notificationrequest) | Yes | **NotificationRequest** object.| +| userId | number | Yes | ID of the user who receives the notification. | **Example** @@ -178,11 +184,11 @@ Cancels a notification with the specified ID and label. This API uses an asynchr **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | --- | ---- | --------------------- | ---- | -------------------- | -| id | Yes | No | number | Yes | Notification ID. | -| label | Yes | No | string | Yes | Notification label. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| id | number | Yes | Notification ID. | +| label | string | Yes | Notification label. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -206,10 +212,10 @@ Cancels a notification with the specified ID and label. This API uses a promise **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ----- | --- | ---- | ------ | ---- | -------- | -| id | Yes | No | number | Yes | Notification ID. | -| label | Yes | No | string | No | Notification label.| +| Name | Type | Mandatory| Description | +| ----- | ------ | ---- | -------- | +| id | number | Yes | Notification ID. | +| label | string | No | Notification label.| **Example** @@ -231,10 +237,10 @@ Cancels a notification with the specified ID. This API uses an asynchronous call **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| id | Yes | No | number | Yes | Notification ID. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| id | number | Yes | Notification ID. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -258,9 +264,9 @@ Cancels all notifications. This API uses an asynchronous callback to return the **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -306,10 +312,10 @@ Adds a notification slot. This API uses an asynchronous callback to return the r **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| slot | Yes | No | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -341,9 +347,9 @@ Adds a notification slot. This API uses a promise to return the result. **Parameters** -| Name| Readable| Writable| Type | Mandatory| Description | -| ---- | ---- | --- | ---------------- | ---- | -------------------- | -| slot | Yes | No | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| +| Name| Type | Mandatory| Description | +| ---- | ---------------- | ---- | -------------------- | +| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| **Example** @@ -369,10 +375,10 @@ Adds a notification slot. This API uses an asynchronous callback to return the r **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ---------------------- | -| type | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot to add.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ---------------------- | +| type | [SlotType](#slottype) | Yes | Type of the notification slot to add.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -396,9 +402,9 @@ Adds a notification slot. This API uses a promise to return the result. **Parameters** -| Name| Readable| Writable| Type | Mandatory| Description | -| ---- | ---- | --- | -------- | ---- | ---------------------- | -| type | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot to add.| +| Name| Type | Mandatory| Description | +| ---- | -------- | ---- | ---------------------- | +| type | [SlotType](#slottype) | Yes | Type of the notification slot to add.| **Example** @@ -424,10 +430,10 @@ Adds multiple notification slots. This API uses an asynchronous callback to retu **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------- | ---- | ------------------------ | -| slots | Yes | No | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------- | ---- | ------------------------ | +| slots | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -463,9 +469,9 @@ Adds multiple notification slots. This API uses a promise to return the result. **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ----- | ---- | --- | ------------------------- | ---- | ------------------------ | -| slots | Yes | No | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| +| Name | Type | Mandatory| Description | +| ----- | ------------------------- | ---- | ------------------------ | +| slots | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| **Example** @@ -495,10 +501,10 @@ Obtains a notification slot of the specified type. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------------------- | ---- | ----------------------------------------------------------- | -| slotType | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| -| callback | Yes | No | AsyncCallback\<[NotificationSlot](#notificationslot)\> | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | --------------------------------- | ---- | ----------------------------------------------------------- | +| slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| +| callback | AsyncCallback\<[NotificationSlot](#notificationslot)\> | Yes | Callback used to return the result. | **Example** @@ -523,9 +529,9 @@ Obtains a notification slot of the specified type. This API uses a promise to re **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | -------- | ---- | ----------------------------------------------------------- | -| slotType | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| +| Name | Type | Mandatory| Description | +| -------- | -------- | ---- | ----------------------------------------------------------- | +| slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| **Return value** @@ -554,9 +560,9 @@ Obtains all notification slots. This API uses an asynchronous callback to return **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------------------- | ---- | -------------------- | -| callback | Yes | No | AsyncCallback\<[NotificationSlot](#notificationslot)\> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------------------- | ---- | -------------------- | +| callback | AsyncCallback\\> | Yes | Callback used to return the result.| **Example** @@ -604,10 +610,10 @@ Removes a notification slot of the specified type. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ----------------------------------------------------------- | -| slotType | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ----------------------------------------------------------- | +| slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -632,9 +638,9 @@ Removes a notification slot of the specified type. This API uses a promise to re **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | -------- | ---- | ----------------------------------------------------------- | -| slotType | Yes | No | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| +| Name | Type | Mandatory| Description | +| -------- | -------- | ---- | ----------------------------------------------------------- | +| slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| **Example** @@ -657,9 +663,9 @@ Removes all notification slots. This API uses an asynchronous callback to return **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -704,11 +710,11 @@ Subscribes to a notification with the subscription information specified. This A **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------- | ---- | --- | ------------------------- | ---- | ---------------- | -| subscriber | Yes | No | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | -| info | Yes | No | [NotificationSubscribeInfo](#notificationsubscribeinfo) | Yes | Subscription information. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ---------- | ------------------------- | ---- | ---------------- | +| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | Yes | Subscription information. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -745,10 +751,10 @@ Subscribes to a notification with the subscription information specified. This A **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------- | ---- | --- | ---------------------- | ---- | ---------------- | -| subscriber | Yes | No | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ---------- | ---------------------- | ---- | ---------------- | +| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -781,10 +787,10 @@ Subscribes to a notification with the subscription information specified. This A **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------- | ---- | --- | ------------------------- | ---- | ------------ | -| subscriber | Yes | No | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| -| info | Yes | No | [NotificationSubscribeInfo](#notificationsubscribeinfo) | No | Subscription information. | +| Name | Type | Mandatory| Description | +| ---------- | ------------------------- | ---- | ------------ | +| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| +| info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | No | Subscription information. | **Example** @@ -816,10 +822,10 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------- | ---- | --- | ---------------------- | ---- | -------------------- | -| subscriber | Yes | No | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ---------- | ---------------------- | ---- | -------------------- | +| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -852,9 +858,9 @@ Unsubscribes from a notification. This API uses a promise to return the result. **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------- | ---- | --- | ---------------------- | ---- | ------------ | -| subscriber | Yes | No | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| +| Name | Type | Mandatory| Description | +| ---------- | ---------------------- | ---- | ------------ | +| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| **Example** @@ -886,11 +892,11 @@ Sets whether to enable notification for a specified bundle. This API uses an asy **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| enable | Yes | No | boolean | Yes | Whether to enable notification. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| enable | boolean | Yes | Whether to enable notification. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -920,10 +926,10 @@ Sets whether to enable notification for a specified bundle. This API uses a prom **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| -| enable | Yes | No | boolean | Yes | Whether to enable notification. | +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| +| enable | boolean | Yes | Whether to enable notification. | **Example** @@ -952,10 +958,10 @@ Checks whether notification is enabled for a specified bundle. This API uses an **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ------------------------ | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ------------------------ | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -985,9 +991,9 @@ Checks whether notification is enabled for a specified bundle. This API uses a p **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| **Return value** @@ -1022,9 +1028,9 @@ Checks whether notification is enabled for this application. This API uses an as **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ------------------------ | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ------------------------ | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1052,9 +1058,9 @@ Checks whether notification is enabled for this application. This API uses a pro **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| **Return value** @@ -1086,11 +1092,11 @@ Sets whether to enable the notification badge for a specified bundle. This API u **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| enable | Yes | No | boolean | Yes | Whether to enable notification. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| enable | boolean | Yes | Whether to enable notification. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1120,10 +1126,10 @@ Sets the notification slot for a specified bundle. This API uses a promise to re **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| -| enable | Yes | No | boolean | Yes | Whether to enable notification. | +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| +| enable | boolean | Yes | Whether to enable notification. | **Example** @@ -1152,10 +1158,10 @@ Checks whether the notification badge is enabled for a specified bundle. This AP **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ------------------------ | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ------------------------ | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1185,9 +1191,9 @@ Checks whether the notification badge is enabled for a specified bundle. This AP **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| **Return value** @@ -1222,11 +1228,11 @@ Sets the notification slot for a specified bundle. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| slot | Yes | No | [NotificationSlot](#notificationslot) | Yes | Notification slot. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1259,10 +1265,10 @@ Sets the notification slot for a specified bundle. This API uses a promise to re **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| -| slot | Yes | No | [NotificationSlot](#notificationslot) | Yes | Whether to enable notification. | +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| +| slot | [NotificationSlot](#notificationslot) | Yes | Whether to enable notification. | **Example** @@ -1294,10 +1300,10 @@ Obtains the notification slots of a specified bundle. This API uses an asynchron **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ---------------------------------------- | ---- | -------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| callback | Yes | No | AsyncCallback> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ---------------------------------------- | ---- | -------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| callback | AsyncCallback> | Yes | Callback used to return the result.| **Example** @@ -1327,9 +1333,9 @@ Obtains the notification slots of a specified bundle. This API uses a promise to **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| **Return value** @@ -1364,10 +1370,10 @@ Obtains the number of notification slots of a specified bundle. This API uses an **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------- | ---- | ---------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------- | ---- | ---------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1397,9 +1403,9 @@ Obtains the number of notification slots of a specified bundle. This API uses a **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| **Return value** @@ -1434,11 +1440,11 @@ Removes a notification for a specified bundle. This API uses an asynchronous cal **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------------- | ---- | --- | ----------------------------------- | ---- | -------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| notificationKey | Yes | No | [NotificationKey](#notificationkey) | Yes | Notification key. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| --------------- | ----------------------------------- | ---- | -------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1472,10 +1478,10 @@ Removes a notification for a specified bundle. This API uses a promise to return **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------------- | ---- | --- | --------------- | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information.| -| notificationKey | Yes | No | [NotificationKey](#notificationkey) | Yes | Notification key. | +| Name | Type | Mandatory| Description | +| --------------- | --------------- | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information.| +| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | **Example** @@ -1508,10 +1514,10 @@ Removes a notification for a specified bundle. This API uses an asynchronous cal **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| hashCode | Yes | No | string | Yes | Unique notification ID. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| hashCode | string | Yes | Unique notification ID. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1541,9 +1547,9 @@ Removes a notification for a specified bundle. This API uses a promise to return **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ---------- | ---- | ---------- | -| hashCode | Yes | No | string | Yes | Unique notification ID.| +| Name | Type | Mandatory| Description | +| -------- | ---------- | ---- | ---------- | +| hashCode | string | Yes | Unique notification ID.| **Example** @@ -1571,10 +1577,10 @@ Removes all notifications for a specified bundle. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ---------------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ---------------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1604,9 +1610,9 @@ Removes all notifications. This API uses an asynchronous callback to return the **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | -------------------- | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | -------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1634,9 +1640,9 @@ Removes all notifications for a specified user. This API uses a promise to retur **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | No | Bundle information.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| bundle | [BundleOption](#bundleoption) | No | Bundle information.| **Example** @@ -1660,10 +1666,10 @@ Removes all notifications for a specified user. This API uses an asynchronous ca **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| userId | Yes | No | number | Yes | ID of the user who receives the notification.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| userId | number | Yes | ID of the user who receives the notification.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1691,9 +1697,9 @@ Removes all notifications for a specified user. This API uses a promise to retur **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------------ | ---- | ---------- | -| userId | Yes | No | number | Yes | ID of the user who receives the notification.| +| Name | Type | Mandatory| Description | +| ------ | ------------ | ---- | ---------- | +| userId | number | Yes | ID of the user who receives the notification.| **Example** @@ -1722,9 +1728,9 @@ Obtains all active notifications. This API uses an asynchronous callback to retu **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------------------------------------------ | ---- | -------------------- | -| callback | Yes | No | AsyncCallback> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------------------------ | ---- | -------------------- | +| callback | AsyncCallback> | Yes | Callback used to return the result.| **Example** @@ -1748,7 +1754,7 @@ Obtains all active notifications. This API uses a promise to return the result. **Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER -**System API**: This is a system API and cannot be called by third-party applications.removeGroupByBundle +**System API**: This is a system API and cannot be called by third-party applications. **Return value** @@ -1776,9 +1782,9 @@ Obtains the number of active notifications. This API uses an asynchronous callba **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ---------------------- | ---- | ---------------------- | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | ---------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1826,9 +1832,9 @@ Obtains active notifications of this application. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------------------------------------------ | ---- | ------------------------------ | -| callback | Yes | No | AsyncCallback> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------------------------ | ---- | ------------------------------ | +| callback | AsyncCallback> | Yes | Callback used to return the result.| **Example** @@ -1876,10 +1882,10 @@ Cancels a notification group of this application. This API uses an asynchronous **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------- | ---- | --- | --------------------- | ---- | ---------------------------- | -| groupName | Yes | No | string | Yes | Name of the notification group. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| --------- | --------------------- | ---- | ---------------------------- | +| groupName | string | Yes | Name of the notification group. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1905,9 +1911,9 @@ Cancels a notification group of this application. This API uses a promise to ret **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------- | ---- | --- | ------ | ---- | -------------- | -| groupName | Yes | No | string | Yes | Name of the notification group.| +| Name | Type | Mandatory| Description | +| --------- | ------ | ---- | -------------- | +| groupName | string | Yes | Name of the notification group.| **Example** @@ -1934,11 +1940,11 @@ Removes a notification group for a specified bundle. This API uses an asynchrono **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------- | ---- | --- | --------------------- | ---- | ---------------------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| groupName | Yes | No | string | Yes | Name of the notification group. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| --------- | --------------------- | ---- | ---------------------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| groupName | string | Yes | Name of the notification group. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1969,10 +1975,10 @@ Removes a notification group for a specified bundle. This API uses a promise to **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| --------- | ---- | --- | ------------ | ---- | -------------- | -| bundle | Yes | No | [BundleOption](#bundleoption) | Yes | Bundle information. | -| groupName | Yes | No | string | Yes | Name of the notification group.| +| Name | Type | Mandatory| Description | +| --------- | ------------ | ---- | -------------- | +| bundle | [BundleOption](#bundleoption) | Yes | Bundle information. | +| groupName | string | Yes | Name of the notification group.| **Example** @@ -2000,10 +2006,10 @@ Sets the DND time. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ---------------------- | -| date | Yes | No | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ---------------------- | +| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -2037,9 +2043,9 @@ Sets the DND time. This API uses a promise to return the result. **Parameters** -| Name| Readable| Writable| Type | Mandatory| Description | -| ---- | ---- | --- | ---------------- | ---- | -------------- | -| date | Yes | No | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| +| Name| Type | Mandatory| Description | +| ---- | ---------------- | ---- | -------------- | +| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| **Example** @@ -2069,11 +2075,11 @@ Sets the DND time for a specified user. This API uses an asynchronous callback t **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------- | ---- | ---------------------- | -| date | Yes | No | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | -| userId | Yes | No | number | Yes | User ID.| -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ---------------------- | +| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | +| userId | number | Yes | User ID.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -2109,10 +2115,10 @@ Sets the DND time for a specified user. This API uses a promise to return the re **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ---------------- | ---- | -------------- | -| date | Yes | No | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| -| userId | Yes | No | number | Yes | User ID.| +| Name | Type | Mandatory| Description | +| ------ | ---------------- | ---- | -------------- | +| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| +| userId | number | Yes | User ID.| **Example** @@ -2145,9 +2151,9 @@ Obtains the DND time. This API uses an asynchronous callback to return the resul **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------------------- | ---- | ---------------------- | -| callback | Yes | No | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | --------------------------------- | ---- | ---------------------- | +| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| **Example** @@ -2202,10 +2208,10 @@ Obtains the DND time of a specified user. This API uses an asynchronous callback **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------------------- | ---- | ---------------------- | -| callback | Yes | No | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| -| userId | Yes | No | number | Yes | User ID.| +| Name | Type | Mandatory| Description | +| -------- | --------------------------------- | ---- | ---------------------- | +| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| +| userId | number | Yes | User ID.| **Example** @@ -2235,9 +2241,9 @@ Obtains the DND time of a specified user. This API uses a promise to return the **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | --------------------------------- | ---- | ---------------------- | -| userId | Yes | No | number | Yes | User ID.| +| Name | Type | Mandatory| Description | +| -------- | --------------------------------- | ---- | ---------------------- | +| userId | number | Yes | User ID.| **Return value** @@ -2270,9 +2276,9 @@ Checks whether the DND mode is supported. This API uses an asynchronous callback **Parameters** -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------ | ---- | -------------------------------- | -| callback | Yes | No | AsyncCallback\ | Yes | Callback used to return the result.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------ | ---- | -------------------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -2836,10 +2842,13 @@ Cancels a notification published by the reminder agent. This API uses an asynchr **System capability**: SystemCapability.Notification.Notification +**System API**: This is a system API and cannot be called by third-party applications. + **Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER -**Parameters** +**System API**: This is a system API and cannot be called by third-party applications. +**Parameters** | Name | Type | Mandatory| Description | | -------------------- | ------------- | ---- | ------------------------ | @@ -2871,10 +2880,13 @@ Publishes a notification through the reminder agent. This API uses a promise to **System capability**: SystemCapability.Notification.Notification +**System API**: This is a system API and cannot be called by third-party applications. + **Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER -**Parameters** +**System API**: This is a system API and cannot be called by third-party applications. +**Parameters** | Name | Type | Mandatory| Description | | -------------------- | ------ | ---- | ------------------ | @@ -3035,9 +3047,9 @@ Notification.isNotificationSlotEnabled( ``` -## Notification.setSyncNotificationEnabledForUninstallApp9+ +## Notification.setSyncNotificationEnabledWithoutApp9+ -setSyncNotificationEnabledForUninstallApp(userId: number, enable: boolean, callback: AsyncCallback\): void +setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback\): void Sets whether to sync notifications to devices where the application is not installed. This API uses an asynchronous callback to return the result. @@ -3052,8 +3064,8 @@ Sets whether to sync notifications to devices where the application is not insta | Name| Type | Mandatory| Description | | ------ | ----------------------------- | ---- | -------------- | | userId | number | Yes | User ID. | -| enable | boolean | Yes | Whether to sync notifications to devices where the application is not installed. The value **true** means to sync notifications to devices where the application is not installed, and **false** means the opposite.| -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +| enable | boolean | Yes | Whether the feature is enabled.
**true**: enabled
**false**: disabled | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -3061,17 +3073,17 @@ Sets whether to sync notifications to devices where the application is not insta let userId = 100; let enable = true; -function setSyncNotificationEnabledForUninstallAppCallback(err) { - console.log('setSyncNotificationEnabledForUninstallAppCallback'); +function setSyncNotificationEnabledWithoutAppCallback(err) { + console.log('setSyncNotificationEnabledWithoutAppCallback'); } -Notification.setSyncNotificationEnabledForUninstallApp(userId, enable, setSyncNotificationEnabledForUninstallAppCallback); +Notification.setSyncNotificationEnabledWithoutApp(userId, enable, setSyncNotificationEnabledWithoutAppCallback); ``` -## Notification.setSyncNotificationEnabledForUninstallApp9+ +## Notification.setSyncNotificationEnabledWithoutApp9+ -setSyncNotificationEnabledForUninstallApp(userId: number, enable: boolean): Promise\ +setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise\ Sets whether to sync notifications to devices where the application is not installed. This API uses a promise to return the result. @@ -3086,7 +3098,13 @@ Sets whether to sync notifications to devices where the application is not insta | Name| Type | Mandatory| Description | | ------ | ----------------------------- | ---- | -------------- | | userId | number | Yes | User ID. | -| enable | boolean | Yes | Whether to sync notifications to devices where the application is not installed. The value **true** means to sync notifications to devices where the application is not installed, and **false** means the opposite.| +| enable | boolean | Yes | Whether the feature is enabled.
**true**: enabled
**false**: disabled | + +**Return value** + +| Type | Description | +| ----------------------------------------------------------- | ------------------------------------------------------------ | +| Promise\ | Promise used to return the result.| **Example** @@ -3094,21 +3112,21 @@ Sets whether to sync notifications to devices where the application is not insta let userId = 100; let enable = true; -Notification.setSyncNotificationEnabledForUninstallApp(userId, enable) +Notification.setSyncNotificationEnabledWithoutApp(userId, enable) .then((data) => { - console.log('setSyncNotificationEnabledForUninstallApp, data:', data); + console.log('setSyncNotificationEnabledWithoutApp'); }) .catch((err) => { - console.log('setSyncNotificationEnabledForUninstallApp, err:', err); + console.log('setSyncNotificationEnabledWithoutApp, err:', err); }); ``` -## Notification.getSyncNotificationEnabledForUninstallApp9+ +## Notification.getSyncNotificationEnabledWithoutApp9+ -getSyncNotificationEnabledForUninstallApp(userId: number, callback: AsyncCallback\): void +getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback\): void -Checks whether notifications are synced to devices where the application is not installed. This API uses an asynchronous callback to return the result. +Obtains whether notifications are synced to devices where the application is not installed. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Notification.Notification @@ -3121,26 +3139,30 @@ Checks whether notifications are synced to devices where the application is not | Name| Type | Mandatory| Description | | ------ | ----------------------------- | ---- | -------------- | | userId | number | Yes | User ID. | -| callback | AsyncCallback\ | Yes | Callback used to return the result. The value **true** means that notifications are synced to devices where the application is not installed, and **false** means the opposite.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.
**true**: Notifications are synced to devices where the application is not installed.
**false**: Notifications are not synced to devices where the application is not installed.| **Example** ```js let userId = 100; -function getSyncNotificationEnabledForUninstallAppCallback(err, data) { - console.log('getSyncNotificationEnabledForUninstallAppCallback, data: ', data); +function getSyncNotificationEnabledWithoutAppCallback(data, err) { + if (err) { + console.log('getSyncNotificationEnabledWithoutAppCallback, err' + err); + } else { + console.log('getSyncNotificationEnabledWithoutAppCallback, data' + data); + } } -Notification.getSyncNotificationEnabledForUninstallApp(userId, getSyncNotificationEnabledForUninstallAppCallback); +Notification.getSyncNotificationEnabledWithoutApp(userId, getSyncNotificationEnabledWithoutAppCallback); ``` -## Notification.getSyncNotificationEnabledForUninstallApp9+ +## Notification.getSyncNotificationEnabledWithoutApp9+ -getSyncNotificationEnabledForUninstallApp(userId: number): Promise\ +getSyncNotificationEnabledWithoutApp(userId: number): Promise\ -Checks whether notifications are synced to devices where the application is not installed. This API uses a promise to return the result. +Obtains whether notifications are synced to devices where the application is not installed. This API uses a promise to return the result. **System capability**: SystemCapability.Notification.Notification @@ -3158,19 +3180,19 @@ Checks whether notifications are synced to devices where the application is not | Type | Description | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result. The value **true** means that notifications are synced to devices where the application is not installed, and **false** means the opposite.| +| Promise\ | Promise used to return the result.
**true**: Notifications are synced to devices where the application is not installed.
**false**: Notifications are not synced to devices where the application is not installed.| **Example** ```js let userId = 100; -Notification.getSyncNotificationEnabledForUninstallApp(userId) +Notification.getSyncNotificationEnabledWithoutApp(userId) .then((data) => { - console.log('getSyncNotificationEnabledForUninstallApp, data: ', data); + console.log('getSyncNotificationEnabledWithoutApp, data:', data); }) .catch((err) => { - console.log('getSyncNotificationEnabledForUninstallApp, err: ', err); + console.log('getSyncNotificationEnabledWithoutApp, err:', err); }); ``` @@ -3487,13 +3509,13 @@ Notification.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Readable| Writable| Type | Mandatory| Description | -| --------------- | ---- | --- | ------------------------------------------------- | ---- | -------- | -| request | Yes | No | [NotificationRequest](#notificationrequest) | Yes | Notification content.| -| sortingMap | Yes | No | [NotificationSortingMap](#notificationsortingmap) | No | Notification sorting information.| -| reason | Yes | No | number | No | Reason for deletion.| -| sound | Yes | No | string | No | Sound used for notification.| -| vibrationValues | Yes | No | Array\ | No | Vibration used for notification.| +| Name | Readable| Writable| Type | Description | +| --------------- | ---- | --- | ------------------------------------------------- | -------- | +| request | Yes | No | [NotificationRequest](#notificationrequest) | Notification content.| +| sortingMap | Yes | No | [NotificationSortingMap](#notificationsortingmap) | Notification sorting information.| +| reason | Yes | No | number | Reason for deletion.| +| sound | Yes | No | string | Sound used for notification.| +| vibrationValues | Yes | No | Array\ | Vibration used for notification.| ## EnabledNotificationCallbackData8+ @@ -3502,11 +3524,11 @@ Notification.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------- | ---- | ---------------- | -| bundle | Yes | No | string | Yes | Bundle name of the application. | -| uid | Yes | No | number | Yes | UID of the application. | -| enable | Yes | No | boolean | Yes | Notification enabled status of the application.| +| Name | Readable| Writable| Type | Description | +| ------ | ---- | --- | ------- | ---------------- | +| bundle | Yes | No | string | Bundle name of the application. | +| uid | Yes | No | number | UID of the application. | +| enable | Yes | No | boolean | Notification enabled status of the application.| ## DoNotDisturbDate8+ @@ -3566,10 +3588,10 @@ Notification.subscribe(subscriber, subscribeCallback); **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| ------ | ---- | --- | ------ | ---- | ------ | -| bundle | Yes | Yes | string | Yes | Bundle name. | -| uid | Yes | Yes | number | No | User ID.| +| Name | Readable| Writable| Type | Description | +| ------ | ---- | --- | ------ | ------ | +| bundle | Yes | Yes | string | Bundle name. | +| uid | Yes | Yes | number | User ID.| @@ -3577,10 +3599,10 @@ Notification.subscribe(subscriber, subscribeCallback); **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| ----- | ---- | --- | ------ | ---- | -------- | -| id | Yes | Yes | number | Yes | Notification ID. | -| label | Yes | Yes | string | No | Notification label.| +| Name | Readable| Writable| Type | Description | +| ----- | ---- | --- | ------ | -------- | +| id | Yes | Yes | number | Notification ID. | +| label | Yes | Yes | string | Notification label.| ## SlotType @@ -3600,78 +3622,78 @@ Notification.subscribe(subscriber, subscribeCallback); **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| --------- | --- | ---- | ----------------------------------------------- | ---- | ------------------------- | -| title | Yes | Yes | string | Yes | Button title. | -| wantAgent | Yes | Yes | WantAgent | Yes | **WantAgent** of the button.| -| extras | Yes | Yes | { [key: string]: any } | No | Extra information of the button. | -| userInput8+ | Yes | Yes | [NotificationUserInput](#notificationuserinput8) | No | User input object. | +| Name | Readable| Writable| Type | Description | +| --------- | --- | ---- | ----------------------------------------------- | ------------------------- | +| title | Yes | Yes | string | Button title. | +| wantAgent | Yes | Yes | WantAgent | **WantAgent** of the button.| +| extras | Yes | Yes | { [key: string]: any } | Extra information of the button. | +| userInput8+ | Yes | Yes | [NotificationUserInput](#notificationuserinput8) | User input object. | ## NotificationBasicContent **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------- | ---- | ---- | ------ | ---- | ---------------------------------- | -| title | Yes | Yes | string | Yes | Notification title. | -| text | Yes | Yes | string | Yes | Notification content. | -| additionalText | Yes | Yes | string | No | Additional information of the notification.| +| Name | Readable| Writable| Type | Description | +| -------------- | ---- | ---- | ------ | ---------------------------------- | +| title | Yes | Yes | string | Notification title. | +| text | Yes | Yes | string | Notification content. | +| additionalText | Yes | Yes | string | Additional information of the notification.| ## NotificationLongTextContent **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------- | ---- | --- | ------ | ---- | -------------------------------- | -| title | Yes | Yes | string | Yes | Notification title. | -| text | Yes | Yes | string | Yes | Notification content. | -| additionalText | Yes | Yes | string | No | Additional information of the notification.| -| longText | Yes | Yes | string | Yes | Long text of the notification. | -| briefText | Yes | Yes | string | Yes | Brief text of the notification.| -| expandedTitle | Yes | Yes | string | Yes | Title of the notification in the expanded state. | +| Name | Readable| Writable| Type | Description | +| -------------- | ---- | --- | ------ | -------------------------------- | +| title | Yes | Yes | string | Notification title. | +| text | Yes | Yes | string | Notification content. | +| additionalText | Yes | Yes | string | Additional information of the notification.| +| longText | Yes | Yes | string | Long text of the notification. | +| briefText | Yes | Yes | string | Brief text of the notification.| +| expandedTitle | Yes | Yes | string | Title of the notification in the expanded state. | ## NotificationMultiLineContent **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------- | --- | --- | --------------- | ---- | -------------------------------- | -| title | Yes | Yes | string | Yes | Notification title. | -| text | Yes | Yes | string | Yes | Notification content. | -| additionalText | Yes | Yes | string | No | Additional information of the notification.| -| briefText | Yes | Yes | string | Yes | Brief text of the notification.| -| longTitle | Yes | Yes | string | Yes | Title of the notification in the expanded state. | -| lines | Yes | Yes | Array\ | Yes | Multi-line text of the notification. | +| Name | Readable| Writable| Type | Description | +| -------------- | --- | --- | --------------- | -------------------------------- | +| title | Yes | Yes | string | Notification title. | +| text | Yes | Yes | string | Notification content. | +| additionalText | Yes | Yes | string | Additional information of the notification.| +| briefText | Yes | Yes | string | Brief text of the notification.| +| longTitle | Yes | Yes | string | Title of the notification in the expanded state. | +| lines | Yes | Yes | Array\ | Multi-line text of the notification. | ## NotificationPictureContent **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------- | ---- | --- | -------------- | ---- | -------------------------------- | -| title | Yes | Yes | string | Yes | Notification title. | -| text | Yes | Yes | string | Yes | Notification content. | -| additionalText | Yes | Yes | string | No | Additional information of the notification.| -| briefText | Yes | Yes | string | Yes | Brief text of the notification.| -| expandedTitle | Yes | Yes | string | Yes | Title of the notification in the expanded state. | -| picture | Yes | Yes | image.PixelMap | Yes | Picture attached to the notification. | +| Name | Readable| Writable| Type | Description | +| -------------- | ---- | --- | -------------- | -------------------------------- | +| title | Yes | Yes | string | Notification title. | +| text | Yes | Yes | string | Notification content. | +| additionalText | Yes | Yes | string | Additional information of the notification.| +| briefText | Yes | Yes | string | Brief text of the notification.| +| expandedTitle | Yes | Yes | string | Title of the notification in the expanded state. | +| picture | Yes | Yes | image.PixelMap | Picture attached to the notification. | ## NotificationContent **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| ----------- | ---- | --- | ------------------------------------------------------------ | ---- | ------------------ | -| contentType | Yes | Yes | [ContentType](#contenttype) | Yes | Notification content type. | -| normal | Yes | Yes | [NotificationBasicContent](#notificationbasiccontent) | No | Normal text. | -| longText | Yes | Yes | [NotificationLongTextContent](#notificationlongtextcontent) | No | Long text.| -| multiLine | Yes | Yes | [NotificationMultiLineContent](#notificationmultilinecontent) | No | Multi-line text. | -| picture | Yes | Yes | [NotificationPictureContent](#notificationpicturecontent) | No | Picture-attached. | +| Name | Readable| Writable| Type | Description | +| ----------- | ---- | --- | ------------------------------------------------------------ | ------------------ | +| contentType | Yes | Yes | [ContentType](#contenttype) | Notification content type. | +| normal | Yes | Yes | [NotificationBasicContent](#notificationbasiccontent) | Normal text. | +| longText | Yes | Yes | [NotificationLongTextContent](#notificationlongtextcontent) | Long text.| +| multiLine | Yes | Yes | [NotificationMultiLineContent](#notificationmultilinecontent) | Multi-line text. | +| picture | Yes | Yes | [NotificationPictureContent](#notificationpicturecontent) | Picture-attached. | ## NotificationFlagStatus8+ @@ -3691,87 +3713,87 @@ Notification.subscribe(subscriber, subscribeCallback); **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------------- | ---- | ---- | ---------------------- | ---- | --------------------------------- | -| soundEnabled | Yes | No | NotificationFlagStatus | No | Whether to enable the sound alert for the notification. | -| vibrationEnabled | Yes | No | NotificationFlagStatus | No | Whether to enable vibration for the notification. | +| Name | Readable| Writable| Type | Description | +| ---------------- | ---- | ---- | ---------------------- | --------------------------------- | +| soundEnabled | Yes | No | NotificationFlagStatus | Whether to enable the sound alert for the notification. | +| vibrationEnabled | Yes | No | NotificationFlagStatus | Whether to enable vibration for the notification. | ## NotificationRequest **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| --------------------- | ---- | --- | --------------------------------------------- | ---- | -------------------------- | -| content | Yes | Yes | [NotificationContent](#notificationcontent) | Yes | Notification content. | -| id | Yes | Yes | number | No | Notification ID. | -| slotType | Yes | Yes | [SlotType](#slottype) | No | Slot type. | -| isOngoing | Yes | Yes | boolean | No | Whether the notification is an ongoing notification. | -| isUnremovable | Yes | Yes | boolean | No | Whether the notification can be removed. | -| deliveryTime | Yes | Yes | number | No | Time when the notification is sent. | -| tapDismissed | Yes | Yes | boolean | No | Whether the notification is automatically cleared. | -| autoDeletedTime | Yes | Yes | number | No | Time when the notification is automatically cleared. | -| wantAgent | Yes | Yes | WantAgent | No | **WantAgent** instance to which the notification will be redirected after being clicked. | -| extraInfo | Yes | Yes | {[key: string]: any} | No | Extended parameters. | -| color | Yes | Yes | number | No | Background color of the notification. | -| colorEnabled | Yes | Yes | boolean | No | Whether the notification background color is enabled. | -| isAlertOnce | Yes | Yes | boolean | No | Whether the notification triggers an alert only once.| -| isStopwatch | Yes | Yes | boolean | No | Whether to display the stopwatch. | -| isCountDown | Yes | Yes | boolean | No | Whether to display the countdown time. | -| isFloatingIcon | Yes | Yes | boolean | No | Whether the notification is displayed as a floating icon. | -| label | Yes | Yes | string | No | Notification label. | -| badgeIconStyle | Yes | Yes | number | No | Notification badge type. | -| showDeliveryTime | Yes | Yes | boolean | No | Whether to display the time when the notification is delivered. | -| actionButtons | Yes | Yes | Array\<[NotificationActionButton](#notificationactionbutton)\> | No | Buttons in the notification. Up to two buttons are allowed. | -| smallIcon | Yes | Yes | PixelMap | No | Small notification icon. | -| largeIcon | Yes | Yes | PixelMap | No | Large notification icon. | -| creatorBundleName | Yes | No | string | No | Name of the bundle that creates the notification. | -| creatorUid | Yes | No | number | No | UID used for creating the notification. | -| creatorPid | Yes | No | number | No | PID used for creating the notification. | -| creatorUserId8+| Yes | No | number | No | ID of the user who creates the notification. | -| hashCode | Yes | No | string | No | Unique ID of the notification. | -| classification | Yes | Yes | string | No | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | -| groupName8+| Yes | Yes | string | No | Group notification name. | -| template8+ | Yes | Yes | [NotificationTemplate](#notificationtemplate8) | No | Notification template. | -| isRemoveAllowed8+ | Yes | No | boolean | No | Whether the notification can be removed.
**System API**: This is a system API and cannot be called by third-party applications. | -| source8+ | Yes | No | number | No | Notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| distributedOption8+ | Yes | Yes | [DistributedOptions](#distributedoptions8) | No | Option of distributed notification. | -| deviceId8+ | Yes | No | string | No | Device ID of the notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| notificationFlags8+ | Yes | No | [NotificationFlags](#notificationflags8) | No | Notification flags. | -| removalWantAgent9+ | Yes | Yes | WantAgent | No | **WantAgent** instance to which the notification will be redirected when it is removed. | -| badgeNumber9+ | Yes | Yes | number | No | Number of notifications displayed on the application icon. | +| Name | Readable| Writable| Type | Description | +| --------------------- | ---- | --- | --------------------------------------------- | -------------------------- | +| content | Yes | Yes | [NotificationContent](#notificationcontent) | Notification content. | +| id | Yes | Yes | number | Notification ID. | +| slotType | Yes | Yes | [SlotType](#slottype) | Slot type. | +| isOngoing | Yes | Yes | boolean | Whether the notification is an ongoing notification. | +| isUnremovable | Yes | Yes | boolean | Whether the notification can be removed. | +| deliveryTime | Yes | Yes | number | Time when the notification is sent. | +| tapDismissed | Yes | Yes | boolean | Whether the notification is automatically cleared. | +| autoDeletedTime | Yes | Yes | number | Time when the notification is automatically cleared. | +| wantAgent | Yes | Yes | WantAgent | **WantAgent** instance to which the notification will be redirected after being clicked. | +| extraInfo | Yes | Yes | {[key: string]: any} | Extended parameters. | +| color | Yes | Yes | number | Background color of the notification. | +| colorEnabled | Yes | Yes | boolean | Whether the notification background color is enabled. | +| isAlertOnce | Yes | Yes | boolean | Whether the notification triggers an alert only once.| +| isStopwatch | Yes | Yes | boolean | Whether to display the stopwatch. | +| isCountDown | Yes | Yes | boolean | Whether to display the countdown time. | +| isFloatingIcon | Yes | Yes | boolean | Whether the notification is displayed as a floating icon. | +| label | Yes | Yes | string | Notification label. | +| badgeIconStyle | Yes | Yes | number | Notification badge type. | +| showDeliveryTime | Yes | Yes | boolean | Whether to display the time when the notification is delivered. | +| actionButtons | Yes | Yes | Array\<[NotificationActionButton](#notificationactionbutton)\> | Buttons in the notification. Up to two buttons are allowed. | +| smallIcon | Yes | Yes | PixelMap | Small notification icon. | +| largeIcon | Yes | Yes | PixelMap | Large notification icon. | +| creatorBundleName | Yes | No | string | Name of the bundle that creates the notification. | +| creatorUid | Yes | No | number | UID used for creating the notification. | +| creatorPid | Yes | No | number | PID used for creating the notification. | +| creatorUserId8+| Yes | No | number | ID of the user who creates the notification. | +| hashCode | Yes | No | string | Unique ID of the notification. | +| classification | Yes | Yes | string | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | +| groupName8+| Yes | Yes | string | Group notification name. | +| template8+ | Yes | Yes | [NotificationTemplate](#notificationtemplate8) | Notification template. | +| isRemoveAllowed8+ | Yes | No | boolean | Whether the notification can be removed.
**System API**: This is a system API and cannot be called by third-party applications. | +| source8+ | Yes | No | number | Notification source.
**System API**: This is a system API and cannot be called by third-party applications. | +| distributedOption8+ | Yes | Yes | [DistributedOptions](#distributedoptions8) | Option of distributed notification. | +| deviceId8+ | Yes | No | string | Device ID of the notification source.
**System API**: This is a system API and cannot be called by third-party applications. | +| notificationFlags8+ | Yes | No | [NotificationFlags](#notificationflags8) | Notification flags. | +| removalWantAgent9+ | Yes | Yes | WantAgent | **WantAgent** instance to which the notification will be redirected when it is removed. | +| badgeNumber9+ | Yes | Yes | number | Number of notifications displayed on the application icon. | ## DistributedOptions8+ **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| ---------------------- | ---- | ---- | -------------- | ---- | ---------------------------------- | -| isDistributed | Yes | Yes | boolean | No | Whether the notification is a distributed notification. | -| supportDisplayDevices | Yes | Yes | Array\ | Yes | Types of the devices to which the notification can be synchronized. | -| supportOperateDevices | Yes | Yes | Array\ | No | Devices on which notification can be enabled. | -| remindType | Yes | No | number | No | Notification reminder type.
**System API**: This is a system API and cannot be called by third-party applications. | +| Name | Readable| Writable| Type | Description | +| ---------------------- | ---- | ---- | -------------- | ---------------------------------- | +| isDistributed | Yes | Yes | boolean | Whether the notification is a distributed notification. | +| supportDisplayDevices | Yes | Yes | Array\ | Types of the devices to which the notification can be synchronized. | +| supportOperateDevices | Yes | Yes | Array\ | Devices on which notification can be enabled. | +| remindType | Yes | No | number | Notification reminder type.
**System API**: This is a system API and cannot be called by third-party applications. | ## NotificationSlot **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------------- | ---- | --- | --------------------- | ---- | ------------------------------------------ | -| type | Yes | Yes | [SlotType](#slottype) | Yes | Slot type. | -| level | Yes | Yes | number | No | Notification level. If this parameter is not set, the default value is used based on the notification slot type.| -| desc | Yes | Yes | string | No | Notification slot description. | -| badgeFlag | Yes | Yes | boolean | No | Whether to display the badge. | -| bypassDnd | Yes | Yes | boolean | No | Whether to bypass the DND mode in the system. | -| lockscreenVisibility | Yes | Yes | boolean | No | Mode for displaying the notification on the lock screen. | -| vibrationEnabled | Yes | Yes | boolean | No | Whether vibration is supported for the notification. | -| sound | Yes | Yes | string | No | Notification alert tone. | -| lightEnabled | Yes | Yes | boolean | No | Whether the indicator blinks for the notification. | -| lightColor | Yes | Yes | number | No | Indicator color of the notification. | -| vibrationValues | Yes | Yes | Array\ | No | Vibration mode of the notification. | -| enabled9+ | Yes | No | boolean | No | Enabled status of the notification slot. | +| Name | Readable| Writable| Type | Description | +| -------------------- | ---- | --- | --------------------- | ------------------------------------------ | +| type | Yes | Yes | [SlotType](#slottype) | Slot type. | +| level | Yes | Yes | number | Notification level. If this parameter is not set, the default value is used based on the notification slot type.| +| desc | Yes | Yes | string | Notification slot description. | +| badgeFlag | Yes | Yes | boolean | Whether to display the badge. | +| bypassDnd | Yes | Yes | boolean | Whether to bypass the DND mode in the system. | +| lockscreenVisibility | Yes | Yes | number | Mode for displaying the notification on the lock screen. | +| vibrationEnabled | Yes | Yes | boolean | Whether vibration is supported for the notification. | +| sound | Yes | Yes | string | Notification alert tone. | +| lightEnabled | Yes | Yes | boolean | Whether the indicator blinks for the notification. | +| lightColor | Yes | Yes | number | Indicator color of the notification. | +| vibrationValues | Yes | Yes | Array\ | Vibration mode of the notification. | +| enabled9+ | Yes | No | boolean | Enabled status of the notification slot. | ## NotificationSorting @@ -3780,11 +3802,11 @@ Notification.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | ---- | --- | ------------------------------------- | ---- | ------------ | -| slot | Yes | No | [NotificationSlot](#notificationslot) | Yes | Notification slot content.| -| hashCode | Yes | No | string | Yes | Unique ID of the notification.| -| ranking | Yes | No | number | Yes | Notification sequence number.| +| Name | Readable| Writable| Type | Description | +| -------- | ---- | --- | ------------------------------------- | ------------ | +| slot | Yes | No | [NotificationSlot](#notificationslot) | Notification slot content.| +| hashCode | Yes | No | string | Unique ID of the notification.| +| ranking | Yes | No | number | Notification sequence number.| ## NotificationSortingMap @@ -3793,10 +3815,10 @@ Notification.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Readable| Writable| Type | Mandatory| Description | -| -------------- | ---- | --- | ------------------------------------------------------------ | ---- | ---------------- | -| sortings | Yes | No | {[key: string]: [NotificationSorting](#notificationsorting)} | Yes | Array of notification sorting information.| -| sortedHashCode | Yes | No | Array\ | Yes | Array of unique notification IDs.| +| Name | Readable| Writable| Type | Description | +| -------------- | ---- | --- | ------------------------------------------------------------ | ---------------- | +| sortings | Yes | No | {[key: string]: [NotificationSorting](#notificationsorting)} | Array of notification sorting information.| +| sortedHashCode | Yes | No | Array\ | Array of unique notification IDs.| ## NotificationSubscribeInfo @@ -3805,10 +3827,10 @@ Notification.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Readable| Writable| Type | Mandatory| Description | -| ----------- | --- | ---- | --------------- | ---- | ------------------------------- | -| bundleNames | Yes | Yes | Array\ | No | Bundle names of the applications whose notifications are to be subscribed to.| -| userId | Yes | Yes | number | No | User whose notifications are to be subscribed to. | +| Name | Readable| Writable| Type | Description | +| ----------- | --- | ---- | --------------- | ------------------------------- | +| bundleNames | Yes | Yes | Array\ | Bundle names of the applications whose notifications are to be subscribed to.| +| userId | Yes | Yes | number | User whose notifications are to be subscribed to. | ## NotificationTemplate8+ @@ -3825,9 +3847,9 @@ Notification.subscribe(subscriber, subscribeCallback); **System capability**: SystemCapability.Notification.Notification -| Name | Readable| Writable| Type | Mandatory| Description | -| -------- | --- | ---- | ------ | ---- | ----------------------------- | -| inputKey | Yes | Yes | string | Yes | Key to identify the user input.| +| Name | Readable| Writable| Type | Description | +| -------- | --- | ---- | ------ | ----------------------------- | +| inputKey | Yes | Yes | string | Key to identify the user input.| ## DeviceRemindType8+ -- GitLab