Interface UnbluVisitorClient
-
- All Superinterfaces:
UnbluClient
public interface UnbluVisitorClient extends UnbluClient
The client to access the Unblu suite functionality like chat, co-browsing etc.Before using the API, ensure that in your app manifest file points you use either the class
UnbluApplication
or a custom subclass of it for the application. Check its class documentation for further details.If you want to use audio/video sessions, please ensure the following permissions are added to your manifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
A typical flow for the usage would be:
Activity.onCreate(Bundle)
{
UnbluVisitorClient
//create the client.Unblu.createVisitorClient(Application, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback)
U))
...
}
show UnbluUi {
//the Unblu UI should be added to aViewGroup
UnbluClient.getMainView()
}
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<PersonInfo>
getPersonInfoAsync()
Returns the information of the current person.io.reactivex.rxjava3.core.Observable<java.lang.Boolean>
isAgentAvailable()
Return an observable boolean that checks agent availabilityvoid
isAgentAvailable(SuccessCallback<java.lang.Boolean> success, NotInitializedExceptionCallback failure)
Checks if at least one agent is available for co-browsing / chat.void
joinConversation(java.lang.String pin, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Joins an Unblu co-browsing session that was started by an agent.default void
setConversationInterceptor(ConversationInterceptor conversationInterceptor)
Set the given conversation interceptor which is triggered for each new conversation.void
setConversationInterceptor(ConversationInterceptorWithRecipient conversationInterceptor)
void
setNamedArea(java.lang.String namedArea)
Sets or updates the named area.
IMPORTANT: this has only an effect on the queue filtering when a new conversation request is done and will not affect the configuration.void
startNewConversation(com.unblu.sdk.core.internal.visitor.ConversationType conversationType, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type.default void
startNewConversation(com.unblu.sdk.core.internal.visitor.ConversationType conversationType, java.lang.String visitorData, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type.void
startNewConversation(com.unblu.sdk.core.internal.visitor.ConversationType conversationType, java.lang.String visitorData, ConversationRecipient conversationRecipient, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type.-
Methods inherited from interface com.unblu.sdk.core.UnbluClient
deinitClient, getCustomLoadingViewCreator, getMainView, getNotificationApi, getOpenConversation, getOpenConversationValue, getPersonInfo, getUnreadMessagesCount, isCallUiOpen, isCallUiOpen, isDeInitialized, isInErrorState, onApiDeInitialized, onCustomConversationActionInvocationReceived, onMessageCustomActionInvocationReceived, onPersonActivityChanged, onPersonChanged, onPersonCustomActionInvocationReceived, onUiPreloaded, onUiReady, onUnreadMessagesCount, openConversation, openConversationOverview, setAccessToken, setApplicationContext, setAutoHideUiOnBack, setBackButtonCallback, setBackButtonPressTriggerEvent, setCustomCookies, setCustomLoadingViewCreator
-
-
-
-
Method Detail
-
startNewConversation
void startNewConversation(@NonNull com.unblu.sdk.core.internal.visitor.ConversationType conversationType, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type. If the UI was already shown, it will open the conversation in the UI.
If it was not, the Unblu UI should be displayed
UnbluClient.getMainView()
This is an asynchronous call. Use the callbacks to check for success / failure.
- Parameters:
conversationType
- The initial type of the new conversation.success
- Optional callback that will be called with theUnbluConversation
after the conversation was started and is display (if there is a UI).failure
- Optional callback if there was problem to start the conversation.
-
startNewConversation
default void startNewConversation(@NonNull com.unblu.sdk.core.internal.visitor.ConversationType conversationType, @Nullable java.lang.String visitorData, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type. If the UI was already shown, it will open the conversation in the UI.
If it was not, the Unblu UI should be displayed
UnbluClient.getMainView()
This is an asynchronous call. Use the callbacks to check for success / failure.
- Parameters:
conversationType
- The initial type of the new conversation.visitorData
- Custom datasuccess
- Optional callback that will be called with theUnbluConversation
instance after the conversation was started and is display (if there is a UI).failure
- Optional callback if there was problem to start the conversation.
-
startNewConversation
void startNewConversation(@NonNull com.unblu.sdk.core.internal.visitor.ConversationType conversationType, @Nullable java.lang.String visitorData, @Nullable ConversationRecipient conversationRecipient, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Starts a new conversation with the given conversation type. If the UI was already shown, it will open the conversation in the UI.
If it was not, the Unblu UI should be displayed
UnbluClient.getMainView()
This is an asynchronous call. Use the callbacks to check for success / failure.
- Parameters:
conversationType
- The initial type of the new conversation.visitorData
- Custom dataconversationRecipient
- Custom recipient datasuccess
- Optional callback that will be called with theUnbluConversation
instance after the conversation was started and is display (if there is a UI).failure
- Optional callback if there was problem to start the conversation.
-
joinConversation
void joinConversation(@NonNull java.lang.String pin, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.InitConversationExceptionCallback failure)
Joins an Unblu co-browsing session that was started by an agent.This is an asynchronous call. Use the callbacks to check for success / failure.
- Parameters:
pin
- The pin of the conversation which shall be joined. (The pin is provided by the agent desk.)success
- Optional callback that will be called with theUnbluConversation
instance once the conversation was successfully joined.failure
- Optional callback that will be called if the conversation could not be joined.
-
isAgentAvailable
void isAgentAvailable(@NonNull SuccessCallback<java.lang.Boolean> success, @Nullable NotInitializedExceptionCallback failure)
Checks if at least one agent is available for co-browsing / chat.This is an asynchronous call. Use the callbacks to check for success / failure.
- Parameters:
success
- Callback that will be called with true if at least one agent is available, false otherwise.failure
- Optional callback that will be called on failure.
-
isAgentAvailable
io.reactivex.rxjava3.core.Observable<java.lang.Boolean> isAgentAvailable()
Return an observable boolean that checks agent availability- Returns:
- Observable
-
setConversationInterceptor
default void setConversationInterceptor(ConversationInterceptor conversationInterceptor)
Set the given conversation interceptor which is triggered for each new conversation.- Parameters:
conversationInterceptor
- the specified conversation interceptor
-
setConversationInterceptor
void setConversationInterceptor(ConversationInterceptorWithRecipient conversationInterceptor)
-
setNamedArea
void setNamedArea(java.lang.String namedArea)
Sets or updates the named area.
IMPORTANT: this has only an effect on the queue filtering when a new conversation request is done and will not affect the configuration. To affect the configuration, the name area has to be defined in theUnbluClientConfiguration
.- Parameters:
namedArea
- The named area meta tag id which is configured on the agent desk.
-
getPersonInfoAsync
@Nullable io.reactivex.rxjava3.core.Single<PersonInfo> getPersonInfoAsync()
Returns the information of the current person. It is recommended to use this function over #getPersonInfo as it ensures that the person info is retrieved even if the internal state is not fully loaded yet due to some internal optimizations (the visitor session is not yet connected, because e.g. there was no UI displayed yet). This functions ensures everything gets upgraded to a state that the person info is available and will then be returned.- Returns:
- the info of the current person wrapped in a Single
- Throws:
java.lang.IllegalStateException
- if the API is not initializedUnsupportedCollaborationServerVersionException
- if the used collaboration server is not of version 5.x, newer than 5.17, or newer than 6.3
-
-