Skip to content

Function: addVoIPPushTokenUpdatedListener()

ts
function addVoIPPushTokenUpdatedListener(listener): EventSubscription;

Defined in: Calls.ts:925

Subscribes to VoIP token updated events.

Fired when the VoIP push token is received or updated after calling registerVoIPPush. Also fired if the token is invalidated (with token being undefined).

Parameters

ParameterTypeDescription
listener(event) => voidCallback invoked when the VoIP token updates.

Returns

EventSubscription

A subscription that can be removed by calling .remove().

Example

typescript
const subscription = addVoIPPushTokenUpdatedListener((event) => {
  if (event.token) {
    console.log('New VoIP token:', event.token);
    sendTokenToBackend(event.token);
  } else {
    console.log('VoIP token invalidated');
  }
});

See

Released under the MIT License.