CallEventListener
Callback interface for handling VoIP call lifecycle events.
Implement this interface to integrate your VoIP calling solution (WebRTC, Twilio, Agora, etc.) with Pushwoosh VoIP push notifications. The SDK invokes these callbacks when users interact with incoming calls or when system events occur.
Registration:
Register your implementation in AndroidManifest.xml:
<application>
<meta-data
android:name="com.pushwoosh.CALL_EVENT_LISTENER"
android:value="com.yourapp.YourCallEventListener" />
</application>Typical Implementation:
class YourCallEventListener : CallEventListener {
override fun onAnswer(voIPMessage: PushwooshVoIPMessage, videoState: Int) {
// User answered - start your VoIP connection and navigate to call screen
}
override fun onReject(voIPMessage: PushwooshVoIPMessage) {
// User rejected - notify your backend if needed
}
override fun onDisconnect(voIPMessage: PushwooshVoIPMessage) {
// Call ended - cleanup resources and close call UI
}
// Implement other methods as needed for your use case
}Note: All callbacks run on the main thread. The default implementation logs events only.
See also
Functions
Called when the user answers an incoming call.
Called when the call is added to Android InCallService.
Called when call cancellation fails.
Called when the remote party cancels the call before it's answered.
Called when the call is removed from Android InCallService.
Called when Android Telecom creates an incoming connection.
Called when the call is disconnected (by user or remote party).
Called when the user rejects an incoming call.