Skip to content

ViberCall

Lejla Solak edited this page Jun 7, 2023 · 2 revisions

extends Call



options()

Description

Returns the call options with which the call was started.



setEventListener(viberCallEventListener)

Description

Configures event handler for viber call events.

Arguments

  • viberCallEventListener: ViberCallEventListener - Interface with event methods that should be implemented, method per viber call event to be handled.

Returns

  • N/A

Example

InfobipRTC infobipRTC = InfobipRTC.getInstance();
ViberCall viberCall = (ViberCall) infobipRTC.getActiveCall();
viberCall.setEventListener(new DefaultViberCallEventListener() {
    @Override
    public void onRinging(CallRingingEvent callRingingEvent) {
        Toast.makeText(getApplicationContext(), "Ringing!", Toast.LENGTH_LONG);
    }

    @Override
    public void onEstablished(CallEstablishedEvent callEstablishedEvent) {
        Toast.makeText(getApplicationContext(), "Established!", Toast.LENGTH_LONG);
    }

    @Override
    public void onHangup(CallHangupEvent callHangupEvent) {
        Toast.makeText(getApplicationContext(), "Hangup!", Toast.LENGTH_LONG);
    }

    @Override
    public void onError(ErrorEvent errorEvent) {
        Toast.makeText(getApplicationContext(), "Error!", Toast.LENGTH_LONG);
    }
});



getEventListener()

Description

Returns event handler for viber call events.

Arguments

  • none

Returns

  • ViberCallEventListener - Interface that should be implemented in order to handle viber call events properly.

Example

InfobipRTC infobipRTC = InfobipRTC.getInstance();
ViberCall viberCall = (ViberCall) infobipRTC.getActiveCall();
ViberCallEventListener viberCallEventListener = viberCall.getEventListener();

Tutorials

Migration guides

Reference documentation

Clone this wiki locally