Skip to content

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

ParameterTypeRequiredDescription
datastringYesPush 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 onCallInvite listener callback data as the canonical callId
  • 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
  • onCallInvite - Fired when an inbound call invite is received

Built with VitePress.