-
Notifications
You must be signed in to change notification settings - Fork 2
ViberCall
Lejla Solak edited this page Feb 10, 2025
·
3 revisions
extends
Call
ViberCallOptions options()
void setEventListener(ViberCallEventListener viberCallEventListener)
ViberCallEventListener getEventListener()
Returns call options used to construct a Viber call.
none
-
ViberCallOptions
- Call options.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ViberCall viberCall = (ViberCall) infobipRTC.getActiveCall();
ViberCallOptions viberCallOptions = viberCall.options();
Configures event handler for Viber call events.
-
viberCallEventListener
:ViberCallEventListener
- Interface with event methods that should be implemented, method per Viber call event to be handled.
N/A
private void 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);
}
});
}
Returns event handler for Viber call events.
none
-
ViberCallEventListener
- Interface that should be implemented in order to handle Viber call events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
ViberCall viberCall = (ViberCall) infobipRTC.getActiveCall();
ViberCallEventListener viberCallEventListener = viberCall.getEventListener();