Constructors
constructor
- new Notifications(api: Api): Notifications
Properties
api
Methods
getCredentials
- getCredentials(): Promise<null | void | IotCredentials>
Returns Promise<null | void | IotCredentials>
getNotifications
- getNotifications(
organization: string,
limit?: number,
offset?: number,
): Promise<ApiResponse<NotificationsResponse, void>> Parameters
- organization: string
- limit: number = 20
- offset: number = 0
getNotificationsCount
- getNotificationsCount(organization: string): Promise<ApiResponse<number, void>>
Returns Promise<ApiResponse<number, void>>
registerPushEndpoint
- registerPushEndpoint(
payload: {
deviceToken: string;
platform: "ios" | "android";
platformEndpoint: string;
},
): Promise<ApiResponse<void, void>> Parameters
- payload: { deviceToken: string; platform: "ios" | "android"; platformEndpoint: string }
Returns Promise<ApiResponse<void, void>>
updateOneNotification
- updateOneNotification(
organization: string,
notificationId: string,
): Promise<ApiResponse<{ n: number; ok: number }, void>> Parameters
- organization: string
- notificationId: string
Returns Promise<ApiResponse<{ n: number; ok: number }, void>>
updateSeenNotifications
- updateSeenNotifications(
organization: string,
lastNotificationAt?: string,
): Promise<ApiResponse<{ n: number; ok: number }, void>> Parameters
- organization: string
Optional
lastNotificationAt: string
Returns Promise<ApiResponse<{ n: number; ok: number }, void>>