Class Unblu
AgentClient or VisitorClient.
Additionally, it provides access to global events related to the Unblu SDK via Observables.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanEnables the logging of capturing performance, for example, frames per second (FPS).static booleanEnables the debug output of the Unblu SDK. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateAgentClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluAgentClient> success, InitializeExceptionCallback failure) Creates a new instance of theUnbluAgentClient.static voidcreateAgentClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluAgentClient> success, InitializeExceptionCallback failure) Creates a new instance of theUnbluAgentClient.static android.widget.FrameLayoutcreateTwoFactorAuthWebView(android.content.Context context, UnbluClientConfiguration config, com.unblu.sdk.core.internal.webview.UnbluTwoFactorAuthErrorUIConfig errorUIConfig, Consumer<kotlin.Pair<Boolean, String>> onResult) Creates an instance ofFrameLayoutthat hosts a WebView for handling two-factor authentication (2FA).static voidcreateVisitorClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluVisitorClient> success, InitializeExceptionCallback failure) Creates a new instance of theUnbluVisitorClient.static voidcreateVisitorClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluVisitorClient> success, InitializeExceptionCallback failure) Creates a new instance of theUnbluVisitorClient.static LogLevelReturns the log level of the Unblu SDK.static io.reactivex.rxjava3.core.Observable<UnbluAgentClient>Fired when anUnbluAgentClientis available.static io.reactivex.rxjava3.core.Observable<ErrorData>onError()Fired when an internal error occurs.static io.reactivex.rxjava3.core.Observable<UiHideRequestModel>Fired whenever the Unblu UI needs to be hidden.static io.reactivex.rxjava3.core.Observable<UiVisibilityRequestModel>Fired whenever the Unblu UI needs to be displayed.static io.reactivex.rxjava3.core.Observable<UnbluVisitorClient>Fired when anUnbluVisitorClientis available.static voidsetLogLevel(LogLevel logLevel) Sets the log level of the Unblu SDK.
-
Field Details
-
enableDebugOutput
public static boolean enableDebugOutputEnables the debug output of the Unblu SDK. The debug output contains additional information on log messages and is independent of the log level defined usingsetLogLevel(LogLevel). The default value isfalse, that is, debug output is disabled. -
enableCapturingPerformanceLogging
public static boolean enableCapturingPerformanceLoggingEnables the logging of capturing performance, for example, frames per second (FPS). The default value isfalse, that is, capturing performance logging is disabled.
-
-
Method Details
-
createVisitorClient
public static void createVisitorClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluVisitorClient> success, @Nullable InitializeExceptionCallback failure) Creates a new instance of theUnbluVisitorClient. The instance returned can then be used to access Unblu features such as chat, co-browsing, or calls. Which features are available depends on the modules you register and the collaboration server configuration.Use this method if you initialize Unblu when there's no activity, otherwise use the method
createVisitorClient(Application, Activity, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback).The instance should be maintained across the application as long as Unblu is in use. If the instance enters an error state it's automatically deinitialized (
UnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)). When this occurs, you can initialize the instance again afterwards.- Parameters:
application- AnApplicationinstanceunbluClientConfiguration- AnUnbluClientConfigurationinstancenotificationApi- An implementation ofUnbluNotificationApisuccess-SuccessCallbackfailure-InitializeExceptionCallback
-
createAgentClient
public static void createAgentClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluAgentClient> success, @Nullable InitializeExceptionCallback failure) Creates a new instance of theUnbluAgentClient. The instance returned can then be used to access Unblu features such as chat, co-browsing, or calls. Which features are available depends on the modules you register and the collaboration server configuration.Use this method if you initialize Unblu when there's no activity, otherwise use the method
createAgentClient(Application, Activity, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback).The instance should be maintained across the application as long as Unblu is used. If the instance enters an error state, it's automatically deinitialized (
UnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)). When this occurs, you can initialize the instance again afterwards.- Parameters:
application- AnApplicationinstanceunbluClientConfiguration- AnUnbluClientConfigurationinstancenotificationApi- An implementation ofUnbluNotificationApisuccess-SuccessCallbackfailure-InitializeExceptionCallback
-
createVisitorClient
public static void createVisitorClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluVisitorClient> success, @Nullable InitializeExceptionCallback failure) Creates a new instance of theUnbluVisitorClient. The instance returned can then be used to access Unblu features such as chat, co-browsing, or calls. Which features are available depends on the modules you register and the collaboration server configuration.Use this method if you already have an activity, otherwise use the method
createVisitorClient(Application, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback).The instance should be maintained across the application as long as Unblu is in use. If the instance enters an error state it's automatically deinitialized (
UnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)). When this occurs, you can initialize the instance again afterwards.- Parameters:
application- AnApplicationinstanceactivity- The currentActivityunbluClientConfiguration- AnUnbluClientConfigurationinstancenotificationApi- An implementation ofUnbluNotificationApisuccess-SuccessCallbackfailure-InitializeExceptionCallback
-
createAgentClient
public static void createAgentClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluAgentClient> success, @Nullable InitializeExceptionCallback failure) Creates a new instance of theUnbluAgentClient. The instance returned can then be used to access Unblu features such as chat, co-browsing, or calls. Which features are available depends on the modules you register and the collaboration server configuration.Use this method if you already have an activity, otherwise use the method
createAgentClient(Application, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback).The instance should be maintained across the application as long as Unblu is in use. If the instance enters an error state it's automatically deinitialized (
UnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)). When this occurs, you can initialize the instance again afterwards.- Parameters:
application- AnApplicationinstanceactivity- the currentActivityunbluClientConfiguration- AnUnbluClientConfigurationinstancenotificationApi- An implementation ofUnbluNotificationApisuccess-SuccessCallbackfailure-InitializeExceptionCallback
-
createTwoFactorAuthWebView
public static android.widget.FrameLayout createTwoFactorAuthWebView(@NotNull android.content.Context context, @NotNull UnbluClientConfiguration config, @NotNull com.unblu.sdk.core.internal.webview.UnbluTwoFactorAuthErrorUIConfig errorUIConfig, Consumer<kotlin.Pair<Boolean, String>> onResult) Creates an instance ofFrameLayoutthat hosts a WebView for handling two-factor authentication (2FA).Note: This isn't available for agents who log in with single sign-on (SSO).
- Parameters:
context- The application context used to initialize the view.config- The configuration settings required for theUnbluClient.errorUIConfig- The UI configuration used to customize the appearance of the error view and buttons.onResult- A callback function that receives aPair:- Boolean — whether the authentication was successful.
- String — an error message if authentication failed, or
nullon success.
- Returns:
- A newly created
FrameLayoutinstance containing the configured 2FA WebView.
-
setLogLevel
Sets the log level of the Unblu SDK. Any messages with a lower log level than the one specified here go unlogged.
The default value isLogLevel.VERBOSE. In release builds, the VERBOSE and DEBUG logs are stripped out via proguard.- Parameters:
logLevel- The log level to set- See Also:
-
getLogLevel
Returns the log level of the Unblu SDK. Any messages with a lower log level than the one specified here go unlogged.- Returns:
- The log level of the Unblu SDK.
- See Also:
-
onUiVisibilityRequest
public static io.reactivex.rxjava3.core.Observable<UiVisibilityRequestModel> onUiVisibilityRequest()Fired whenever the Unblu UI needs to be displayed. This happens when a push notification for a call comes in, for example, or if the user clicks a notification and a conversation should be displayed. You should observe this from the beginning of the application running so you receive visibility requests related to notifications.- Returns:
- An
Observablethat emitsUiVisibilityRequestModeldata
-
onUiHideRequest
Fired whenever the Unblu UI needs to be hidden. This happens when mobile co-browsing is started, for example.- Returns:
- An
Observablethat emitsUiHideRequestModeldata
-
onError
Fired when an internal error occurs. Normally this is the case ifUnbluClientcouldn't load anything from the Unblu server.
The error message is intended for internal use only. It isn't localized and shouldn't be displayed to users.- Returns:
- An
Observablethat emitsErrorData
-
onAgentInitialized
Fired when anUnbluAgentClientis available. The client instance is provided in an initialized state, ready to use.- Returns:
- An
Observablethat emits each time anUnbluAgentClientis initialized.
-
onVisitorInitialized
Fired when anUnbluVisitorClientis available. The client instance is provided in an initialized state, ready to use.- Returns:
- An
Observablethat emits each time anUnbluVisitorClientis initialized.
-