Class Unblu
- java.lang.Object
-
- com.unblu.sdk.core.Unblu
-
public class Unblu extends java.lang.Object
Main class to initialize either theAgentClient
orVisitorClient
. Additionally it provides access to global events related to the Unblu SDK via Observables. This class is the entry point where implementation of the Unblu Mobile SDK should begin
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
enableCapturingPerformanceLogging
Enables/disable logging of capturing performance (e.g.static boolean
enableDebugOutput
Enables/disable the debug output of the Unblu SDK.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
createAgentClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluAgentClient> success, InitializeExceptionCallback failure)
This creates a new instance of theUnbluAgentClient
.static void
createAgentClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluAgentClient> success, InitializeExceptionCallback failure)
This creates a new instance of theUnbluAgentClient
.static void
createVisitorClient(android.app.Application application, android.app.Activity activity, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluVisitorClient> success, InitializeExceptionCallback failure)
This creates a new instance of theUnbluVisitorClient
.static void
createVisitorClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, InitializeSuccessCallback<UnbluVisitorClient> success, InitializeExceptionCallback failure)
This creates a new instance of theUnbluVisitorClient
.static LogLevel
getLogLevel()
Returns the log level of the Unblu SDK.static io.reactivex.rxjava3.core.Observable<UnbluAgentClient>
onAgentInitialized()
Fired when anUnbluAgentClient
is available.static io.reactivex.rxjava3.core.Observable<ErrorData>
onError()
Fired when an internal error occurs.static io.reactivex.rxjava3.core.Observable<UiHideRequestModel>
onUiHideRequest()
Fired whenever the Unblu ui needs to be hidden.static io.reactivex.rxjava3.core.Observable<UiVisibilityRequestModel>
onUiVisibilityRequest()
Fired whenever the Unblu ui needs to be displayed.static io.reactivex.rxjava3.core.Observable<UnbluVisitorClient>
onVisitorInitialized()
Fired when anUnbluVisitorClient
is available.static void
setLogLevel(LogLevel logLevel)
Sets the log level of the Unblu SDK.
-
-
-
Field Detail
-
enableDebugOutput
public static boolean enableDebugOutput
Enables/disable the debug output of the Unblu SDK. This contains additional information on log messages and is independent of the log level defined withsetLogLevel(LogLevel)
.
-
enableCapturingPerformanceLogging
public static boolean enableCapturingPerformanceLogging
Enables/disable logging of capturing performance (e.g. FPS)
-
-
Method Detail
-
createVisitorClient
public static void createVisitorClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluVisitorClient> success, @Nullable InitializeExceptionCallback failure)
This creates a new instance of theUnbluVisitorClient
.The returned instance can then be used to access several features of Unblu like the chat, co-browsing, calls (depending on the provided modules).
The instance should be maintained across the application as long as Unblu is used. If you initialize Unblu at a point in time, when there is no activity use this method. Otherwise use the method
createVisitorClient(Application, Activity, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback)
} Notice this instance will be automatically deInitializedUnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)
, should it enter the error state. It can still be initilialized again after.- Parameters:
application
-Application
instanceunbluClientConfiguration
-UnbluClientConfiguration
instancenotificationApi
-UnbluNotificationApi
implementationsuccess
-SuccessCallback
failure
-InitializeExceptionCallback
-
createAgentClient
public static void createAgentClient(android.app.Application application, UnbluClientConfiguration unbluClientConfiguration, UnbluNotificationApi notificationApi, @Nullable InitializeSuccessCallback<UnbluAgentClient> success, @Nullable InitializeExceptionCallback failure)
This creates a new instance of theUnbluAgentClient
.The returned instance can then be used to access several features of Unblu like the chat, co-browsing, calls (depending on the provided modules).
The instance should be maintained across the application as long as Unblu is used. If you initialize Unblu at a point in time, when there is no activity use this method. Otherwise use the method
createAgentClient(Application, Activity, UnbluClientConfiguration, UnbluNotificationApi, InitializeSuccessCallback, InitializeExceptionCallback)
} Notice this instance will be automatically deInitializedUnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)
, should it enter in an Error State. It can still be initilialized again after.- Parameters:
application
-Application
instanceunbluClientConfiguration
-UnbluClientConfiguration
instancenotificationApi
-UnbluNotificationApi
implementationsuccess
-SuccessCallback
failure
-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)
This creates a new instance of theUnbluVisitorClient
.The returned instance can then be used to access several features of Unblu like the chat, co-browsing, calls (depending on the provided modules). Notice this instance will be automatically deInitialized
UnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)
, should it enter in an Error State. It can still be initilialized again after.- Parameters:
application
-Application
instanceactivity
-Activity
current ActivityunbluClientConfiguration
-UnbluClientConfiguration
instancenotificationApi
-UnbluNotificationApi
implementationsuccess
-SuccessCallback
failure
-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)
This creates a new instance of theUnbluAgentClient
.The returned instance can then be used to access several features of Unblu like the chat, co-browsing, calls (depending on the provided modules).
Notice this instance will be automatically deInitializedUnbluClient.deinitClient(SuccessVoidCallback, DeinitializeExceptionCallback)
, should it enter in an Error State. It can still be initilialized again after.- Parameters:
application
-Application
instanceactivity
-Activity
current ActivityunbluClientConfiguration
-UnbluClientConfiguration
instancenotificationApi
-UnbluNotificationApi
implementationsuccess
-SuccessCallback
failure
-InitializeExceptionCallback
-
setLogLevel
public static void setLogLevel(LogLevel logLevel)
Sets the log level of the Unblu SDK. All messages with a lower level will not be logged.
Default isLogLevel.VERBOSE
as in release builds the verbose and debug logs are stripped out via proguard.- Parameters:
logLevel
- Level which should be set- See Also:
getLogLevel()
-
getLogLevel
public static LogLevel getLogLevel()
Returns the log level of the Unblu SDK. All messages with a lower level will not be logged- Returns:
- the log level of the Unblu SDK.
- See Also:
setLogLevel(LogLevel)
-
onUiVisibilityRequest
public static io.reactivex.rxjava3.core.Observable<UiVisibilityRequestModel> onUiVisibilityRequest()
Fired whenever the Unblu ui needs to be displayed. Usually this happens when a certain push notification comes in like phone call for example or if a notification is clicked and a conversation should be displayed. This should be observed from the beggining of the application in order to get notification related visibility requests.- Returns:
Observable
which emitsUiVisibilityRequestModel
data
-
onUiHideRequest
public static io.reactivex.rxjava3.core.Observable<UiHideRequestModel> onUiHideRequest()
Fired whenever the Unblu ui needs to be hidden. Usually this happens when mobile co-browsing is started.
This is only triggered when the used collaboration server is of version newer than 5.17 or newer than 6.3- Returns:
Observable
which emitsUiHideRequestModel
data
-
onError
public static io.reactivex.rxjava3.core.Observable<ErrorData> onError()
Fired when an internal error occurs. Normally this is the case if UnbluClient could not load the anything from the Unblu server. The error message may is not localized and should not be displayed to the user!- Returns:
Observable
which emitsErrorData
-
onAgentInitialized
public static io.reactivex.rxjava3.core.Observable<UnbluAgentClient> onAgentInitialized()
Fired when anUnbluAgentClient
is available. This instance will be provided in an initialized state, ready to use.- Returns:
- an
Observable
that emits each time an Unblu agent API gets initialized.
-
onVisitorInitialized
public static io.reactivex.rxjava3.core.Observable<UnbluVisitorClient> onVisitorInitialized()
Fired when anUnbluVisitorClient
is available. This instance will be provided in an initialized state, ready to use.- Returns:
- an
Observable
that emits each time an Unblu visitor API gets initialized.
-
-