Closes this conversation locally.
When called, the connection to this conversation is closed and the overview is displayed.
Note that:
The conversation can be joined again either via the UI or using UnbluApi.openConversation.
A Promise that resolves to null or is rejected with a UnbluApiError if the call fails.
Destroys this conversation API instance.
Calling destroy will unregister all event listeners and prohibit any further calls to this object. Once the conversation is destroyed, any subsequent calls will reject the returned promise with UnbluErrorType.ILLEGAL_STATE as the reason.
Note that:
This call simply destroys this local API instance to the conversation.
A destroyed but still open conversation can be accessed again using UnbluApi.getActiveConversation.
Ends and closes this conversation.
If the local person doesn't have the right to end the conversation, the returned promise will be rejected with the unblu error type UnbluErrorType.ACTION_NOT_GRANTED.
A Promise that resolves to null or is rejected with a UnbluApiError if the call fails.
A promise that resolves to the current call state of the local user or is rejected with a UnbluApiError if the call fails.
CALL_STATE_CHANGE if you need to listen to changes.
Returns the current connection state the conversation is in.
If the connection is lost, the conversation will automatically try to reconnect using an exponential back-off strategy. If a fatal error is detected, the state will change to ConnectionState.ERROR.
If this happens, the conversation is in it's terminal state. A dialog or other UI will be displayed to the user with details on the failure. The conversation is not automatically closed in this case. It may either be closed through a manual action by the visitor (confirming the error) or via the API.
A promise that resolves to the current connection state of the conversation or is rejected with a UnbluApiError if the call fails.
CONNECTION_STATE_CHANGE if you need to listen to changes.
Returns the current state the conversation is in.
A promise that resolves to the current state of the conversation or is rejected with a UnbluApiError if the call fails.
Returns weather this conversation is destroyed or not.
Conversations are destroyed if destroy is called or the conversation is closed. This usually happens when the user navigates back to an overview or into an other conversation.
Weather this conversation is destroyed or not.
Leaves and closes this conversation.
By leaving, the visitor is removed from the active participant list of the conversation. Once a conversation is left, the visitor can not re-open it. It will not be visible in the conversation history either.
If the local person doesn't have the right to leave the conversation, the returned promise will be rejected with the unblu error type UnbluErrorType.ACTION_NOT_GRANTED.
A Promise that resolves to null or is rejected with a UnbluApiError if the call fails.
Registers an event listener for the given event.
The call state change event.
The listener to be called.
Registers an event listener for the given event.
The conversation state change event.
The listener to be called.
Registers an event listener for the given event.
The call state change event.
The listener to be called.
Registers an event listener for the given event.
The end event.
The listener to be called.
The end event is not always available, depending on the configuration. Use instead CONVERSATION_STATE_CHANGE event.
Registers an event listener for the given event.
The close event.
The listener to be called.
Registers an event listener for the given event.
The customActionInvocation event.
The listener to be called.
Starts a voice call in this conversation.
A Promise that resolves to null or is rejected with a UnbluApiError if the call fails.
CALL_STATE_CHANGE If you need to listen to changes.
Starts a video call in this conversation.
A Promise that resolves to null or is rejected with a UnbluApiError if the call fails.
CALL_STATE_CHANGE If you need to listen to changes.
Static
Readonly
CALL_Event emitted when the CallState of this conversation changes. callStateChange
on for listener registration
Static
Readonly
CLOSEEvent emitted when the conversation is closed.
This may happen due to a UI-navigation or an API-call.
close
on for listener registration
Static
Readonly
CONNECTION_Event emitted when the ConnectionState of this conversation changes. connectionStateChange
on for listener registration
Static
Readonly
CONVERSATION_Event emitted when the ConversationState of this conversation changes. conversationStateChange
on for listener registration
Static
Readonly
CUSTOM_Event emitted every time a custom action is configured to trigger a JS API event for the current client when a custom action is invoked
customActionInvocation
Static
Readonly
ENDEvent emitted when the conversation ends.
The end event is not always available, depending on the configuration. Use the CONVERSATION_STATE_CHANGE event instead. end
on for listener registration
This class gives API access to the currently active conversation.
As long as a conversation is active one can register and receive the events provided by this class and call the methods. Once the conversation is closed this API object will be destroyed and no more event callbacks will be called. Any subsequent calls will fail.
Use the CLOSE event to de-init any code connected to this conversation.