Skip to main content

Class: NotificationService

services/notification.NotificationService

Notification service can be used in the following way:
1. Import the service from our library:

import {NotificationService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `listUserNotification` will return the paginated list of notifications.

async listUserNotification() {
return await NotificationService.listUserNotification();
}
In case of required `params`, just add them inside the brackets.

async disposeBroadcastMessages(banner_ids) {
return await NotificationService.disposeBroadcastMessages(banner_ids);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

1. Declare it(or declare them, it is possible to add multiple params)

const headers = headers: {Authorization: `Bearer ${yourToken}`}

2. Add it inside the brackets and pass it to the function, as shown in the previous example!

Constructors

constructor

new NotificationService(): NotificationService

Returns

NotificationService

Methods

createCustomNotification

createCustomNotification(data, config?): Promise<any>

Parameters

NameType
dataCustomNotificationParams
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/notification/index.ts:164


disposeBroadcastMessages

disposeBroadcastMessages(banner_ids, config?): Promise<any>

Parameters

NameType
banner_idsnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/notification/index.ts:176


getUnseenNotification

getUnseenNotification(config?): Promise<SCNotificationUnseenCountType>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCNotificationUnseenCountType>

Defined in

services/notification/index.ts:161


listBroadcastMessages

listBroadcastMessages(config?): Promise<SCPaginatedResponse<SCBroadcastMessageType>>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCBroadcastMessageType>>

Defined in

services/notification/index.ts:167


listBroadcastMessagesUndisposedCount

listBroadcastMessagesUndisposedCount(config?): Promise<SCNotificationUnseenCountType>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCNotificationUnseenCountType>

Defined in

services/notification/index.ts:173


listBroadcastMessagesUnseenCount

listBroadcastMessagesUnseenCount(config?): Promise<SCNotificationUnseenCountType>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCNotificationUnseenCountType>

Defined in

services/notification/index.ts:170


listUserNotification

listUserNotification(config?): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>

Parameters

NameType
config?AxiosRequestConfig<any>

Returns

Promise<SCPaginatedResponse<SCNotificationAggregatedType>>

Defined in

services/notification/index.ts:155


markReadBroadcastMessages

markReadBroadcastMessages(banner_ids, config?): Promise<any>

Parameters

NameType
banner_idsnumber[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/notification/index.ts:179


markReadNotification

markReadNotification(sids, config?): Promise<any>

Parameters

NameType
sidsstring[]
config?AxiosRequestConfig<any>

Returns

Promise<any>

Defined in

services/notification/index.ts:158