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
| Parameter | Type | Description |
|---|---|---|
listener | (event) => void | Callback 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
- useVoIPPushToken — React hook that uses this internally; prefer it in components.
- registerVoIPPush — must be called once before any token updates fire.