public static final class UnbluApiConfiguration.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(java.lang.String unbluBaseUrl,
java.lang.String apiKey,
UnbluPreferencesStorage preferencesStorage,
UnbluDownloadHandler downloadHandler)
Constructs an api configuration.
|
Builder(UnbluApiConfiguration unbluApiConfiguration)
Constructs an api configuration.
|
Modifier and Type | Method and Description |
---|---|
UnbluApiConfiguration |
build() |
UnbluApiConfiguration.Builder |
registerModule(UnbluModule module)
Registers a module which should be used.
|
UnbluApiConfiguration.Builder |
setApiKey(java.lang.String apiKey)
Changes the api key inside this configuration to the given value.
|
UnbluApiConfiguration.Builder |
setAudioUploadsEnabled(boolean audioUploadsEnabled)
If set to false, audio uploads directly are disabled.
|
UnbluApiConfiguration.Builder |
setCameraUploadsEnabled(boolean cameraUploadsEnabled)
If set to false, uploads directly via the camera app are disabled.
|
UnbluApiConfiguration.Builder |
setCustomCookies(java.util.Set<UnbluCookie> customCookies)
Configures a set of cookies which will be set on the configured base url.
|
UnbluApiConfiguration.Builder |
setDownloadHandler(UnbluDownloadHandler downloadHandler)
Defines the listener for downloads.
|
UnbluApiConfiguration.Builder |
setEntryPath(java.lang.String entryPath)
Sets the entry path inside self configuration to the given value.
|
UnbluApiConfiguration.Builder |
setExternalLinkPatternWhitelist(java.util.List<java.util.regex.Pattern> externalLinkPatternWhitelist)
Sets the list of link patterns that may be opened in the system browser.
|
UnbluApiConfiguration.Builder |
setInternalUrlPatternWhitelist(java.util.List<java.util.regex.Pattern> internalUrlPatternWhitelist)
Sets the list of URL patterns that may be accessed by the WebView.
|
UnbluApiConfiguration.Builder |
setLanguage(java.lang.String language)
Sets the language which will be send to the server to define the language used inside the UI.
|
UnbluApiConfiguration.Builder |
setNamedArea(java.lang.String namedArea)
Sets the named area for which the configuration is loaded as soon as the api is initializing.
|
UnbluApiConfiguration.Builder |
setNotificationsEnabled(boolean notificationsEnabled)
Configures if notifications via unblu are enabled or not
|
UnbluApiConfiguration.Builder |
setPhotoUploadsEnabled(boolean photoUploadsEnabled)
If set to false, photo uploads directly are disabled.
|
UnbluApiConfiguration.Builder |
setPreferencesStorage(UnbluPreferencesStorage preferencesStorage)
Defines the storage implementation to save and retrieve preferences of the SDK.
A default implementation can be used via UnbluPreferencesStorage.createSharedPreferencesStorage(Context) which stores the preferences of the SDK inside the SharedPreferences of the app with Context.MODE_PRIVATE . |
UnbluApiConfiguration.Builder |
setPreloadUiAfterApiInitEnabled(boolean preloadUiAfterApiInitEnabled)
Enables/disables if the UI should be preloaded, after the unblu api was initialized once.
|
UnbluApiConfiguration.Builder |
setUnbluBaseUrl(java.lang.String unbluBaseUrl) |
UnbluApiConfiguration.Builder |
setVideoUploadsEnabled(boolean videoUploadsEnabled)
If set to false, video uploads directly are disabled.
|
UnbluApiConfiguration.Builder |
unregisterModule(UnbluModule module)
Unregister a modle which should no longer be used.
|
public Builder(@NonNull UnbluApiConfiguration unbluApiConfiguration)
param unbluApiConfiguration The current UnbluConfiguration object
public Builder(@NonNull java.lang.String unbluBaseUrl, @NonNull java.lang.String apiKey, @NonNull UnbluPreferencesStorage preferencesStorage, @NonNull UnbluDownloadHandler downloadHandler)
unbluBaseUrl
- The url to the unblu server. (full URL: http(s)://domain:port)apiKey
- Your unblu API key (can be retrieved / created on the unblu agent desk).preferencesStorage
- The storage implementation to save and retrieve preferences of the SDKdownloadHandler
- The download handler implementation to handle file downloads.public UnbluApiConfiguration.Builder setUnbluBaseUrl(@NonNull java.lang.String unbluBaseUrl)
public UnbluApiConfiguration.Builder setApiKey(@NonNull java.lang.String apiKey)
apiKey
- Your unblu API key (can be retrieved / created on the unblu agent desk).public UnbluApiConfiguration.Builder setInternalUrlPatternWhitelist(@NonNull java.util.List<java.util.regex.Pattern> internalUrlPatternWhitelist)
This restricts access to:
The configured baseURL will be automatically added to the list. This is mainly required if you use redirects from the initial base url to a different domain or if resources like web fonts are loaded from other locations.
internalUrlPatternWhitelist
- List of url patterns which may be accessed by the WebViewpublic UnbluApiConfiguration.Builder setExternalLinkPatternWhitelist(@NonNull java.util.List<java.util.regex.Pattern> externalLinkPatternWhitelist)
Those are typical links from the chat which are clicked by the user.
The following patterns are added per default, and will be overridden by calling this function.
^\Qhttps://\E.*
^\Qmailto://\E.*
^\Qtel:\E.*
If a link does not match one of those patterns, clicking on it, will not do anything with it.
externalLinkPatternWhitelist
- List of url patterns which may be opened in the system browserpublic UnbluApiConfiguration.Builder setEntryPath(@NonNull java.lang.String entryPath)
entryPath
- The entry path used to connect to the unblu server. Typicall value is "/unblu" or "/co-unblu".public UnbluApiConfiguration.Builder setPreloadUiAfterApiInitEnabled(boolean preloadUiAfterApiInitEnabled)
preloadUiAfterApiInitEnabled
- If set to true, the UI will be pre loaded after the api was initialized successfully. Otherwise the UI will be loaded, when it is requested to be shown. If you want to do a pre load of the UI manually, use UnbluCoreApi.preloadUi(IUnbluApiSuccessVoidCallback, IUnbluApiNotInitializedExceptionCallback)
.public UnbluApiConfiguration.Builder setCustomCookies(@NonNull java.util.Set<UnbluCookie> customCookies)
customCookies
- The cookies which will later be used on the configured base url.public UnbluApiConfiguration.Builder setLanguage(@Nullable java.lang.String language)
language
- The language which is set to the server.public UnbluApiConfiguration.Builder setNamedArea(@Nullable java.lang.String namedArea)
namedArea
- The named area meta tag id configured in the agent desk.public UnbluApiConfiguration.Builder setNotificationsEnabled(boolean notificationsEnabled)
notificationsEnabled:
- if true, notifications are enabled. Otherwise they are disabledpublic UnbluApiConfiguration.Builder setCameraUploadsEnabled(boolean cameraUploadsEnabled)
Manifest.permission#READ_EXTERNAL_STORAGE
.
It could be considered as unsafe for security reasons.
This will set both setVideoUploadsEnabled(boolean)
and setPhotoUploadsEnabled(boolean)
to the specified value
cameraUploadsEnabled
- If set to true, uploads directly via the camera app are enabled.public UnbluApiConfiguration.Builder setVideoUploadsEnabled(boolean videoUploadsEnabled)
Manifest.permission#READ_EXTERNAL_STORAGE
.
It could be considered as unsafe for security reasons.videoUploadsEnabled
- If set to true, video uploads directly via the camera app are enabled.public UnbluApiConfiguration.Builder setAudioUploadsEnabled(boolean audioUploadsEnabled)
audioUploadsEnabled
- If set to true, audio uploads are enabled.public UnbluApiConfiguration.Builder setPhotoUploadsEnabled(boolean photoUploadsEnabled)
Manifest.permission#READ_EXTERNAL_STORAGE
.
It could be considered as unsafe for security reasons.photoUploadsEnabled
- If set to true, photo uploads directly via the camera app are enabled.public UnbluApiConfiguration.Builder setPreferencesStorage(@NonNull UnbluPreferencesStorage preferencesStorage)
UnbluPreferencesStorage.createSharedPreferencesStorage(Context)
which stores the preferences of the SDK inside the SharedPreferences of the app with Context.MODE_PRIVATE
.preferencesStorage
- The storage where the SDK will safe its preferences to.public UnbluApiConfiguration.Builder registerModule(@NonNull UnbluModule module)
module
- The module to registerpublic UnbluApiConfiguration.Builder unregisterModule(@NonNull UnbluModule module)
module
- The module to unregisterpublic UnbluApiConfiguration.Builder setDownloadHandler(@NonNull UnbluDownloadHandler downloadHandler)
UnbluDownloadHandler.createExternalStorageDownloadHandler(Context)
. It stores the files into the public downloads directory.downloadHandler
- The listener which handles all file downloadspublic UnbluApiConfiguration build()