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
| Parameter | Type | Required | Description |
|---|---|---|---|
pushToken | string | Yes | FCM 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 Type | Error Code | Description |
|---|---|---|
SESSION_ERROR | Various session/auth codes | Session/token state is invalid during registration |
NETWORK_ERROR | internal:error:serviceNotAvailable | Network/service failure while registering token |
CS_ERROR | Various backend push codes | Backend rejected token registration |
UNKNOWN_ERROR | N/A | Unexpected 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
deviceIdso you can unregister token mappings when needed - For inbound call pushes, pair registration with
VoiceClient.getPushNotificationType(...)andprocessPushCallInvite - iOS uses
registerVoipToken; Web does not expose push token registration in Voice API
Related Actions
registerVoipToken- Register iOS VoIP push token for incoming call delivery
Related Events
onCallInvite- Fired when an inbound call invite is received