1# Managing Notification Slots 2The system supports a range of notification slots. Different notification slots are assigned different reminder modes. You can choose notification slots for your application and manage them as required, such as creating, querying, and deleting notification slots. 3 4## Notification Slots 5 6The following table lists the notification slots and their reminder modes. **Y** indicates that the feature is supported, and **N** indicates that the feature is not supported. 7 8| SlotType | Value | Category | Notification Panel| Banner| Lock Screen| Alert Tone/Vibration| Status Bar Icon| Automatic Screen-on| 9| -------------------- | ------ | --------| ------- |------|------|----------|-----------|---------| 10| SOCIAL_COMMUNICATION | 1 | Social communication| Y | Y | Y | Y | Y | Y | 11| SERVICE_INFORMATION | 2 | Service notification| Y | N | Y | Y | Y | Y | 12| CONTENT_INFORMATION | 3 | Content and news| Y | N | N | N | Y | N | 13| CUSTOMER_SERVICE | 5 | Customer service| Y | N | N | Y | Y | N | 14| OTHER_TYPES | 0xFFFF | Other | Y | N | N | N | N | N | 15 16 17## Available APIs 18 19| **API**| **Description**| 20| ---------- | -------- | 21| [addSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanageraddslot-1)(type: SlotType, callback: AsyncCallback\<void\>): void <br> [addSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanageraddslot-1)(type: SlotType): Promise\<void\> | Adds a notification slot. | 22| [getSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagergetslot)(slotType: SlotType, callback: AsyncCallback\<NotificationSlot\>): void <br>[getSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagergetslot-1)(slotType: SlotType): Promise\<NotificationSlot\> | Obtains a notification slot. | 23| [getSlots](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagergetslots)(callback: AsyncCallback\<Array\<NotificationSlot>>): void <br> [getSlots](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagergetslots-1)(): Promise\<Array\<NotificationSlot>> | Obtains all notification slots for this application. | 24| [removeSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagerremoveslot)(slotType: SlotType, callback: AsyncCallback\<void\>): void <br> [removeSlot](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagerremoveslot-1)(slotType: SlotType): Promise\<void\> | Removes a notification slot for this application. | 25| [removeAllSlots](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagerremoveallslots)(callback: AsyncCallback\<void\>): void <br> [removeAllSlots](../reference/apis-notification-kit/js-apis-notificationManager.md#notificationmanagerremoveallslots-1)(): Promise\<void\> | Removes all notification slots for this application. | 26 27In addition to using **addslot()**, you can also create a notification slot by passing **notificationSlotType** in the [NotificationRequest](../reference/apis-notification-kit/js-apis-inner-notification-notificationRequest.md#notificationrequest). If the specified notification slot does not exist, it is automatically created. 28 29## How to Develop 30 311. Import the **notificationManager** module. 32 33 ```ts 34 import notificationManager from '@ohos.notificationManager'; 35 import Base from '@ohos.base'; 36 ``` 37 382. Add a notification slot. 39 40 ```ts 41 import Base from '@ohos.base'; 42 43 // addSlot callback 44 let addSlotCallBack = (err: Base.BusinessError): void => { 45 if (err) { 46 console.error(`addSlot failed, code is ${err.code}, message is ${err.message}`); 47 } else { 48 console.info("addSlot success"); 49 } 50 } 51 notificationManager.addSlot(notificationManager.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack); 52 ``` 53 543. Obtain a notification slot. 55 56 ```ts 57 // getSlot callback 58 let getSlotCallback = (err: Base.BusinessError, data: notificationManager.NotificationSlot): void => { 59 if (err) { 60 console.error(`getSlot failed, code is ${err.code}, message is ${err.message}`); 61 } else { 62 console.info(`getSlot success, data is ${JSON.stringify(data)}`); 63 } 64 } 65 let slotType: notificationManager.SlotType = notificationManager.SlotType.SOCIAL_COMMUNICATION; 66 notificationManager.getSlot(slotType, getSlotCallback); 67 ``` 68 694. Remove a notification slot. 70 71 ```ts 72 // removeSlot callback 73 let removeSlotCallback = (err: Base.BusinessError): void => { 74 if (err) { 75 console.error(`removeSlot failed, code is ${err.code}, message is ${err.message}`); 76 } else { 77 console.info("removeSlot success"); 78 } 79 } 80 let slotType = notificationManager.SlotType.SOCIAL_COMMUNICATION; 81 notificationManager.removeSlot(slotType, removeSlotCallback); 82 ``` 83