Skip to navigation

PushService (interface)

Web SDK v5 API reference
View as Markdown

PushService

Interface for registering push tokens and handling push notifications for incoming calls.

Since: 5.2.0

Methods

handlePushNotification

handlePushNotification(notificationData: UnknownObject): Promise<void>

Reports a received push notification back to the Voximplant Cloud.

The notification data is sent as a JSON string within the notification data message, available at the messagePayload.data.voximplant path. It should be parsed via JSON.parse()

before being passed to this method.

If the user is not yet logged in, the request is queued and the data is sent automatically once the login process completes.

Returns a promise that resolves after the notification data is successfully sent to the cloud.

Since: 5.2.0

Parameters

ParameterTypeRequirementDescription
notificationDataUnknownObjectRequiredVoximplant-specific payload from the push notification

Returns: Promise<void>

registerPushToken

registerPushToken(options: PushTokenOptions): Promise<void>

Registers a push token for the logged in user in the Voximplant cloud.

If the user is not yet logged in, the request is queued and sent automatically once the login process completes.

Returns a promise that resolves when the token is successfully registered.

Since: 5.2.0

Parameters

ParameterTypeRequirementDescription
optionsPushTokenOptionsRequiredPush token registration options

Returns: Promise<void>

Throws

unregisterPushToken

unregisterPushToken(options: PushTokenOptions): Promise<void>

Unregisters a push token for the logged in user in the Voximplant cloud.

If the user is not yet logged in, the request is queued and sent automatically once the login process completes.

Returns a promise that resolves when the token is successfully unregistered.

Since: 5.2.0

Parameters

ParameterTypeRequirementDescription
optionsPushTokenOptionsRequiredPush token unregistration options

Returns: Promise<void>

Throws