Package com.unblu.sdk.core.conversation
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 Summary
Modifier and TypeMethodDescriptionvoidclose(SuccessVoidCallback success, OpenConversationOverviewExceptionCallback failure) Closes the conversation.voiddisplayAsModalView(UnbluAnimationData animSource) Displays this conversation via the configured modal view handler.getId()io.reactivex.rxjava3.core.Observable<Integer>Returns anObservablethat emits anIntegervalue represent unread messages for this conversationio.reactivex.rxjava3.core.Observable<Boolean>Triggered when a call starts or stops in the conversation.booleanio.reactivex.rxjava3.core.Observable<Boolean>Triggered when the call UI for the conversation is opened or closed.booleanio.reactivex.rxjava3.core.Observable<Boolean>Triggered when the state of a document co-browsing session in the conversation switches between ACTIVE and INACTIVE.booleanio.reactivex.rxjava3.core.Observable<Boolean>Triggered when the state of a mobile co-browsing session in the conversation switches between ACTIVE and INACTIVE.booleanio.reactivex.rxjava3.core.Observable<Boolean>isOpen()Triggered whenever this conversation opens/closes withBooleanvalue This Observable will always emit the current valuevoidopen(SuccessVoidCallback success, OpenConversationExceptionCallback failure) Opens the conversation.voidstartAudioCall(SuccessVoidCallback success, StartAudioCallExceptionCallback failure) Opens the conversation in the background and starts an audio call.voidstartMobileCoBrowsing(SuccessVoidCallback success, MobileCoBrowsingExceptionCallback failure) Opens the conversation in the background and launches mobile co-browsing.voidstartVideoCall(SuccessVoidCallback success, StartVideoCallExceptionCallback failure) Opens the conversation in the background and starts a video call.voidstopDocumentCoBrowsing(SuccessVoidCallback success, DocumentCoBrowsingExceptionCallback failure) Stops the active document co-browsing session within the conversation.voidstopMobileCoBrowsing(SuccessVoidCallback success, MobileCoBrowsingExceptionCallback failure) Stops mobile co-browsing in the conversation.
-
Method Details
-
getId
String getId()- Returns:
- A
Stringcontaining the conversation's ID
-
displayAsModalView
Displays this conversation via the configured modal view handler. -
isOpen
io.reactivex.rxjava3.core.Observable<Boolean> isOpen()Triggered whenever this conversation opens/closes withBooleanvalue This Observable will always emit the current value- Returns:
Observable
-
isOpenValue
Boolean isOpenValue()- Returns:
- true if the conversation is currently open
-
open
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 openedfailure- : A callback returningOpenConversationErrorTypeif the request fails
-
close
Closes the conversation. If the Unblu View is visible, the conversation overview is displayed.- Parameters:
success- : A callback returning a void resultfailure- : A callback returningOpenConversationOverviewErrorTypeif 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<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<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 answeredfailure- A callback returningStartAudioCallErrorTypeif 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 answeredfailure- A callback returningStartVideoCallErrorTypeif 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<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
-
isDocumentCoBrowsingActiveValue
boolean isDocumentCoBrowsingActiveValue()- Returns:
- true if document co-browsing is active for the conversation. If the `DocumentCoBrowsingModule` isn't registered the method returns false.
-
isDocumentCoBrowsingActive
io.reactivex.rxjava3.core.Observable<Boolean> isDocumentCoBrowsingActive()Triggered when the state of a document co-browsing session in the conversation switches between ACTIVE and INACTIVE. The method emits the current state when subscribed and subsequently emits on each state change.
The `DocumentCoBrowsingModule` 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 returningMobileCoBrowsingErrorTypeif 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 returningMobileCoBrowsingErrorTypeif the request fails.
-
getUnreadMessagesCount
io.reactivex.rxjava3.core.Observable<Integer> getUnreadMessagesCount()Returns anObservablethat emits anIntegervalue represent unread messages for this conversation -
stopDocumentCoBrowsing
void stopDocumentCoBrowsing(@Nullable SuccessVoidCallback success, @Nullable DocumentCoBrowsingExceptionCallback failure) Stops the active document co-browsing session within the conversation.
The `DocumentCoBrowsingModule` must be registered to use this function.
-