Notifications

Notifications

# new Notifications()

Methods

# (static) get(pagingQuery) → {Promise.<PagingResult.<Array.<Notification>>>}

Returns notifications based on the provided query.
Parameters:
Name Type Description
pagingQuery PagingQuery.<NotificationsQuery> Query to filter notifications.
Returns:
Promise with list of notifications and cursor for next query.
Type
Promise.<PagingResult.<Array.<Notification>>>

# (static) getCount(pagingQuery) → {Promise.<number>}

Returns number of notifications based on the provided query.
Parameters:
Name Type Description
pagingQuery PagingQuery.<NotificationsQuery> Query to filter notifications.
Returns:
- Promise with number of notifications based on the query.
Type
Promise.<number>

# (static) send(content, target) → {Promise.<void>}

Sends the provided notification content to the recipients.
Parameters:
Name Type Description
content NotificationContent Content of push notification.
target SendNotificationTarget List of recipients.
Returns:
- Promise.
Type
Promise.<void>

# (static) setStatus(status, notificationIds) → {Promise.<boolean>}

Updates notification(s) status.
Parameters:
Name Type Description
status string Status defined in NotificationStatus.
notificationIds Array.<string> IDs of Notifications to be updated.
Returns:
Promise with true if successful.
Type
Promise.<boolean>