Interface UnbluVisitorClient

All Superinterfaces:
UnbluClient

public interface UnbluVisitorClient extends UnbluClient
The client for visitors to access the Unblu suite functionality like chat, co-browsing etc.

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 Details

    • 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 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 with UnbluClient.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 the UnbluConversation 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 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 with UnbluClient.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 data
      success - Optional callback that will be called with the UnbluConversation 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 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 with 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 data
      conversationRecipient - Custom recipient data
      success - Optional callback that will be called with the UnbluConversation 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 the UnbluConversation 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 the UnbluConversation 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

      void setConversationInterceptor(ConversationInterceptorWithRecipient conversationInterceptor)
      Set the given conversation interceptor which is triggered for each new conversation.
      Parameters:
      conversationInterceptor - the specified conversation interceptor
    • setNamedArea

      void setNamedArea(String namedArea)
      Sets or updates the named area for the queue. To affect the configuration, the name area has to be defined in the UnbluClientConfiguration.
      Parameters:
      namedArea - The named area meta tag ID
    • getPersonInfoAsync

      @Nullable io.reactivex.rxjava3.core.Single<PersonInfo> getPersonInfoAsync()
      Returns the information of the current person. It is recommended to use this function over UnbluClient.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 initialized
      UnsupportedCollaborationServerVersionException - if the used collaboration server is not of version 5.x, newer than 5.17, or newer than 6.3
    • isMobileCoBrowsing

      io.reactivex.rxjava3.core.Observable<Boolean> isMobileCoBrowsing()
      Returns the a boolean flag, signaling if there is, or not, an ongoing cobrowsing session.
      Returns:
      boolean flag wrapped in a Observable
    • setActiveConversationIndicatorIcon

      void setActiveConversationIndicatorIcon(UnbluImageResourceWrapper indicatorIcon)
      Sets the icon used for the active conversation floating indicator within the application's user interface. This method allows customization of the floating indicator's appearance by specifying an icon wrapped in an UnbluImageResourceWrapper, which can encapsulate various types of image resources, including drawables, ImageVector objects and URLs.

      Hint: When using a URL resource, provide a square image to ensure the icon's displayed correctly.

      Parameters:
      indicatorIcon - An instance of UnbluImageResourceWrapper representing the new icon to be used for the floating indicator.