addListener()
Note: This API is supported from version 8.1.0-beta01.
The Mobilisten Android SDK provides an interface for various call event callbacks to help developers track events related to call UI, such as when the queue position changes.
Parameters:
- listener (SalesIQCallsListener): An interface containing methods that are triggered for various call-related events:
Supported Events:
Method | Invoken when |
onQueuePositionChanged(String conversationId, int position) | The queue position of a user changes. |
onCallStateChanged(ZohoSalesIQCalls.SalesIQCallState callState) | The call state changes, such as incoming/outgoing or status updates like calling, ringing and more. |
Syntax
Copiedvoid addListener(SalesIQCallsListener listener);
Example
CopiedSalesIQCallsListener listener = new SalesIQCallsListener() {
@Override
public void onQueuePositionChanged(@NonNull String conversationId, int position) {
// Your code here to handle the queue position changed
}
@Override
public void onCallStateChanged(@NonNull ZohoSalesIQCalls.SalesIQCallState callState) {
// Your code here to handle call state changes
}
}
ZohoSalesIQCalls.addListener(listener);
Copiedval salesIQCallsListener = object : SalesIQCallsListener {
override fun onQueuePositionChanged(conversationId: String, position: Int) {
// Your code here to handle the queue position changed
}
override fun onCallStateChanged(callState: ZohoSalesIQCalls.SalesIQCallState) {
super.onCallStateChanged(callState)
// Your code here to handle call state changes
}
}
ZohoSalesIQCalls.addListener(salesIQCallsListener)