public class UnbluAgentApi
extends com.unblu.agentsdk.internal.InternalUnbluAgentApi
Before using the API, ensure that in your app manifest file points you use either the class UnbluAgentApplication
or a custom subclass of it for the application. Check its class documentation for further details.
If you want to use audio/video sessions, please ensure the following permissions are added to your manifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Before calling any other function configureApi(UnbluAgentApiConfiguration)
should be called inside main activity Activity.onCreate(Bundle)
.
The constants of IUnbluEventApi
can be used to register for events via a BroadcastReceiver
and access their values. The easier way is to subclass the UnbluEventReceiver
and override the methods according to the events which you want to listen for.
A typical flow for the usage would be:
Activity.onCreate(Bundle)
{
UnbluAgentApi
.getInstance()
.UnbluCoreApi.configureApi(UnbluCoreApiConfiguration)
//register for general errors and/or also other events
unbluBroadcastReceiver = new UnbluEventReceiver
(getApplicationContext()) {
...
//start the api. This could also be done later when it is needed, but it will take a while until the api is ready.
UnbluAgentApi
.getInstance()
.UnbluCoreApi.initApi(IUnbluApiSuccessfullyInitializedCallback, IUnbluApiInitializeExceptionCallback)
(success: {<success handling>}, failure: {<error handling>}))
...
}
showUnblUi {
//the unblu UI should be shown
UnbluAgentApi
.UnbluCoreApi.showUi(boolean, IUnbluApiSuccessVoidCallback, IUnbluShowUiExceptionCallback)
(true, success: {<success handling>}, failure: {<error handling>});
}
ANIMATION_TIME, enableCapturingPerformanceLogging, enableDebugOutput
Modifier and Type | Method and Description |
---|---|
void |
configureApi(UnbluAgentApiConfiguration configuration)
Configures the unblu api.
|
static UnbluAgentApi |
getInstance() |
addPrivateView, configureApi, deinitApi, getApplication, getCustomLoadingViewCreator, getLogLevel, getOpenConversationId, getPersonInfo, getUiBottomMargin, getUiTopMargin, getUnreadMessagesCount, initApi, internalGetCoreInstance, isCallActive, isCallUiOpen, isInErrorState, isInitialized, isMobileCoBrowsingActive, isNotificationsEnabled, isUiVisible, openConversation, openConversationOverview, preloadUi, removePrivateArea, removePrivateView, setAutoHideUiOnBack, setBackButtonCallback, setCustomCookies, setCustomLoadingViewCreator, setLogLevel, setNamedArea, setPrivateArea, setScreenCapturer, setUiMargins, showUi, showUi, startAudioCall, startVideoCall, stopMobileCoBrowsing
public static UnbluAgentApi getInstance()
UnbluAgentApi
. Only for internal use!public void configureApi(UnbluAgentApiConfiguration configuration)
UnbluCoreApi.initApi(IUnbluApiSuccessfullyInitializedCallback, IUnbluApiInitializeExceptionCallback)
to be able start new sessions and use other API features.
Note:
configureApi
in class com.unblu.agentsdk.internal.InternalUnbluAgentApi
configuration
- The configuration for the unblu apijava.lang.IllegalStateException
- Thrown if the api was already initialized. The api needs to be deinitialized to configure it.