Interface UnbluVisitorClient
- All Superinterfaces:
UnbluClient
Before using the API, ensure that in your app manifest file, you use either the class UnbluApplication
or a custom subclass of it for the application. Check its class documentation for further details.
Depending on your use case, you may need to add various permissions to your Android manifest file. Refer to the Unblu documentation for more information.
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<PersonInfo>
Returns the information of the current person.io.reactivex.rxjava3.core.Observable<Boolean>
Return an observable boolean that checks agent availabilityvoid
isAgentAvailable
(SuccessCallback<Boolean> success, NotInitializedExceptionCallback failure) Checks if at least one agent is available for co-browsing / chat.void
joinConversation
(String pin, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure) Deprecated.void
joinConversation
(String pin, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.IUnbluJoinConversationErrorCallback failure) Joins an Unblu co-browsing session that was started by an agent.default void
setConversationInterceptor
(ConversationInterceptor conversationInterceptor) Deprecated.void
setConversationInterceptor
(ConversationInterceptorWithRecipient conversationInterceptor) Set the given conversation interceptor which is triggered for each new conversation.void
setNamedArea
(String namedArea) Sets or updates the named area for the queue.void
startNewConversation
(ConversationType conversationType, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure) Starts a new conversation with the given conversation type.default void
startNewConversation
(ConversationType conversationType, String visitorData, SuccessCallback<UnbluConversation> success, com.unblu.sdk.core.internal.InitConversationExceptionCallback failure) Starts a new conversation with the given conversation type.void
startNewConversation
(ConversationType conversationType, 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
addPersonLabel, deinitClient, getConversations, getCustomLoadingViewCreator, getMainView, getNotificationApi, getOpenConversation, getOpenConversationValue, getPersonInfo, getUnreadMessagesCount, isCallUiOpen, isCallUiOpen, isDeInitialized, isInErrorState, isMobileCoBrowsing, isModalViewVisible, isModalViewVisibleValue, onApiDeInitialized, onConversationsChanged, onCustomConversationActionInvocationReceived, onMessageCustomActionInvocationReceived, onPersonActivityChanged, onPersonChanged, onPersonCustomActionInvocationReceived, onUiPreloaded, onUiReady, onUnreadMessagesCount, openConversation, openConversationOverview, removePersonLabel, setAccessToken, setActiveConversationIndicatorButtonClickInterceptor, setActiveConversationIndicatorIcon, setApplicationContext, setAutoHideUiOnBack, setBackButtonCallback, setBackButtonPressTriggerEvent, setCollapseUIButtonClickInterceptor, setCustomCookies, setCustomLoadingViewCreator, setModalMode, setModalViewEnabled, setUnbluModaViewHandler
-
Method Details
-
startNewConversation
void startNewConversation(@NonNull 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 Unblu UI is displayed, the method opens the conversation in the UI. If the Unblu UI hasn't been displayed yet, you can get it withUnbluClient.getMainView()
.If you use the method with this signature, the visitorData will be null and the
ConversationRecipient
will be the account.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 ConversationType conversationType, @Nullable 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 Unblu UI is displayed, the method opens the conversation in the UI. If the Unblu UI hasn't been displayed yet, you can get it withUnbluClient.getMainView()
.If you use the method with this signature, the
ConversationRecipient
will be the account.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 ConversationType conversationType, @Nullable 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 Unblu UI is displayed, the method opens the conversation in the UI. If the Unblu UI hasn't been displayed yet, you can get it withUnbluClient.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
@Deprecated void joinConversation(@NonNull String pin, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.InitConversationExceptionCallback failure) Deprecated.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.
-
joinConversation
void joinConversation(@NonNull String pin, @Nullable SuccessCallback<UnbluConversation> success, @Nullable com.unblu.sdk.core.internal.IUnbluJoinConversationErrorCallback 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<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<Boolean> isAgentAvailable()Return an observable boolean that checks agent availability- Returns:
- Observable
-
setConversationInterceptor
@Deprecated default void setConversationInterceptor(ConversationInterceptor conversationInterceptor) Deprecated.Set the given conversation interceptor which is triggered for each new conversation.- Parameters:
conversationInterceptor
- the specified conversation interceptor
-
setConversationInterceptor
Set the given conversation interceptor which is triggered for each new conversation.- Parameters:
conversationInterceptor
- the specified conversation interceptor
-
setNamedArea
Sets or updates the named area for the queue. To affect the configuration, the name area has to be defined in theUnbluClientConfiguration
.- Parameters:
namedArea
- The named area meta tag ID
-
getPersonInfoAsync
Returns the information of the current person. It is recommended to use this function overUnbluClient.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:
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
-