Interface UnbluConversation


  • public interface UnbluConversation
    Defines the contract for managing conversations in Unblu. This interface provides methods to manage the lifecycle of a conversation, including opening and closing conversations, handling state changes, managing voice and video calls, and controlling mobile co-browsing sessions. It allows for real-time updates on the status of conversations and calls, and offers callbacks for success and failure scenarios.
    • Method Detail

      • getId

        java.lang.String getId()
        Returns:
        A String containing the conversation's ID
      • isOpen

        io.reactivex.rxjava3.core.Observable<java.lang.Boolean> isOpen()
        Triggered whenever the conversation opens or closes. The method emits the current state when first called and subsequently emits on each state change.
        Returns:
        Observable
      • isOpenValue

        java.lang.Boolean isOpenValue()
        Returns:
        true if the conversation is currently open
      • open

        void open​(SuccessVoidCallback success,
                  OpenConversationExceptionCallback failure)
        Opens the conversation. Any conversation that was open previously is replaced by this conversation.
        If the Unblu View isn't visible, the conversation is displayed as soon as the Unblu View is opened.
        Parameters:
        success - : A callback returning a void result when the conversation was opened
        failure - : A callback returning OpenConversationErrorType if the request fails
      • isCallActiveValue

        boolean isCallActiveValue()
        Returns:
        true if a call is active for the conversation.
        If the `CallModule` isn't registered, the method always returns false.
      • isCallActive

        io.reactivex.rxjava3.core.Observable<java.lang.Boolean> isCallActive()
        Triggered when a call starts or stops in the conversation. The method emits the current state when first called and subsequently emits on each state change.

        If the `CallModule` isn't registered the method emits false once.

        Returns:
        Observable
      • isCallUiOpen

        io.reactivex.rxjava3.core.Observable<java.lang.Boolean> isCallUiOpen()
        Triggered when the call UI for the conversation is opened or closed. The method emits the current state when first called and subsequently emits on each state change.

        you must register the `CallModule` to use this function.

        Returns:
        Observable
      • isCallUiOpenValue

        boolean isCallUiOpenValue()
        Returns:
        true if the call UI for the conversation is open. If the `CallModule` isn't registered the method always returns false.
      • startAudioCall

        void startAudioCall​(@Nullable
                            SuccessVoidCallback success,
                            @Nullable
                            StartAudioCallExceptionCallback failure)
        Opens the conversation in the background and starts an audio call.
        The `CallModule` must be registered to use this function.
        Parameters:
        success - : A callback returning a void type after the call has started, that is, once the call has been initiated, independently of whether it's been answered
        failure - A callback returning StartAudioCallErrorType if the request fails.
      • startVideoCall

        void startVideoCall​(@Nullable
                            SuccessVoidCallback success,
                            @Nullable
                            StartVideoCallExceptionCallback failure)
        Opens the conversation in the background and starts a video call.
        The `CallModule` must be registered to use this function.
        Parameters:
        success - : A callback returning a void type after the call has started, that is, once the call has been initiated, independently of whether it's been answered
        failure - A callback returning StartVideoCallErrorType if the request fails.
      • isMobileCoBrowsingActiveValue

        boolean isMobileCoBrowsingActiveValue()
        Returns:
        true if co-browsing is active for the conversation. If the `MobileCoBrowsingModule` isn't registered the method returns false.
      • isMobileCoBrowsingActive

        io.reactivex.rxjava3.core.Observable<java.lang.Boolean> isMobileCoBrowsingActive()
        Triggered when the state of a mobile co-browsing session in the conversation switches between ACTIVE and INACTIVE. The method emits the current state when first called and subsequently emits on each state change.
        The `MobileCoBrowsingModule` must be registered to use this function.
        Returns:
        Observable
      • startMobileCoBrowsing

        void startMobileCoBrowsing​(@Nullable
                                   SuccessVoidCallback success,
                                   @Nullable
                                   MobileCoBrowsingExceptionCallback failure)
        Opens the conversation in the background and launches mobile co-browsing.
        The `MobileCoBrowsingModule` must be registered to use this function.
        Parameters:
        success - : A callback returning a void type.
        failure - A callback returning MobileCoBrowsingErrorType if the request fails.
      • stopMobileCoBrowsing

        void stopMobileCoBrowsing​(@Nullable
                                  SuccessVoidCallback success,
                                  @Nullable
                                  MobileCoBrowsingExceptionCallback failure)
        Stops mobile co-browsing in the conversation.
        The `MobileCoBrowsingModule` must be registered to use this function.
        Parameters:
        success - : A callback returning a void type.
        failure - A callback returning MobileCoBrowsingErrorType if the request fails.