Skip to content

Register Device Push Token ​

Registers an Android device push token for incoming call push delivery. Successful registration returns a deviceId that should be stored for device-level push token lifecycle management.

Signature ​

// Callback version
fun registerDevicePushToken(
  pushToken: String,
  callback: (Exception?, String?) -> Unit
)

// Suspend version
suspend fun registerDevicePushToken(
  pushToken: String
): String

Parameters ​

ParameterTypeRequiredDescription
pushTokenstringYesFCM push token for the current device/app install

Return Type ​

Returns deviceId in callback/coroutine completion on success.

Usage Example ​


// Callback
client.registerDevicePushToken("PushToken") { err, deviceId ->
    when {
        err != null -> {  } // handle error
        else -> println(deviceId)
    }
}

// Coroutine
try {
    val deviceId = client.registerDevicePushToken("PushToken")
    println(deviceId)
}
catch (e:Error) {
    // Handle Error in registering push token
}

Errors ​

Error TypeError CodeDescription
SESSION_ERRORVarious session/auth codesSession/token state is invalid during registration
NETWORK_ERRORinternal:error:serviceNotAvailableNetwork/service failure while registering token
CS_ERRORVarious backend push codesBackend rejected token registration
UNKNOWN_ERRORN/AUnexpected failure

For complete error reference and handling guidelines, see Error Reference.

Notes ​

  • This action is Android-only and should be called after session creation
  • Persist returned deviceId so you can unregister token mappings when needed
  • For inbound call pushes, pair registration with VoiceClient.getPushNotificationType(...) and processPushCallInvite
  • iOS uses registerVoipToken; Web does not expose push token registration in Voice API
  • onCallInvite - Fired when an inbound call invite is received

Built with VitePress.