Process Push Call Invite
Parses and processes an incoming Android push payload for a voice invite. This method validates the Vonage payload and returns the callId when the payload contains a voice call invite.
Signature
fun processPushCallInvite(
data: String
): String?
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Push payload data (typically RemoteMessage.data.toString()) |
Return Type
Returns callId when payload parsing succeeds, or null when payload is not a valid voice invite.
Usage Example
val dataString = "remoteMessage.data.toString()" // Push payload from FirebaseMessagingService.onMessageReceived
val pushType = VoiceClient.getPushNotificationType(dataString)
if (pushType == PushType.INCOMING_CALL) {
val callId = client.processPushCallInvite(dataString)
println("Processing call invite for call: $callId")
}
Notes
- Call this after confirming payload type with
VoiceClient.getPushNotificationType(...) - On success, this method triggers the normal invite delivery flow and returns the same invite call ID
- Do not rely on this return value as your source of truth for active call state; use
onCallInvitelistener callback data as the canonicalcallId - Use
extractJsonFromPushData(...)behavior implicitly via SDK when payload is map-string formatted - This action is Android-only; iOS uses
processCallInvitePushData, and Web does not expose push-invite processing
Related Actions
answer- Answer an inbound call invitereject- Reject an inbound call inviteregisterDevicePushToken- Register Android push token for incoming call delivery
Related Events
onCallInvite- Fired when an inbound call invite is received