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 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 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
                                          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 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
                                  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 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

        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 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<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

        @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​(java.lang.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:
        java.lang.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<java.lang.Boolean> isMobileCoBrowsing()
        Returns the a boolean flag, signaling if there is, or not, an ongoing cobrowsing session.
        Returns:
        boolean flag wrapped in a Observable