public abstract class UnbluCoreApiConfiguration<C extends UnbluCoreApiConfiguration>
extends java.lang.Object
UnbluCoreApi.configureApi(UnbluCoreApiConfiguration)
call.
There is a base configuration which needs to be given when constructing it. All other configurations are optional.Modifier | Constructor and Description |
---|---|
protected |
UnbluCoreApiConfiguration(java.lang.String unbluBaseUrl,
java.lang.String apiKey)
Constructs an api configuration.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getApiKey()
Returns the currently configured api key.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomCookies()
Returns a copy of the currently configured custom cookies.
|
UnbluDownloadListener |
getDownloadListener()
Returns the listener which is used to handle file downloads.
|
java.lang.String |
getEntryPath()
Returns the currently configured entry path
|
java.util.List<java.util.regex.Pattern> |
getExternalLinkPatternWhitelist()
Returns the currently configured URL patterns which may be opened in the system browser.
|
java.util.List<java.util.regex.Pattern> |
getInternalUrlPatternWhitelist()
Returns the currently configured URL patterns which may be accessed by the WebView
|
java.lang.String |
getLanguage()
Returns the currently configured language.
|
java.lang.String |
getLoginPassword()
Deprecated.
This should no longer be used at all! If the person should be logged in, use
setCustomCookies(Map) with authentication cookies instead |
java.lang.String |
getLoginUsername()
Deprecated.
This should no longer be used at all! If the person should be logged in, use
setCustomCookies(Map) with authentication cookies instead |
java.lang.String |
getNamedArea()
Returns the currently configured named area.
|
UnbluPreferencesStorage |
getPreferencesStorage()
Returns the storage in which unblu saves and restores the preferences of the SDK
|
java.lang.String |
getUnbluBaseUrl()
Returns the currently configured base url.
|
boolean |
isCameraUploadsEnabled() |
boolean |
isNotificationsEnabled() |
boolean |
isPreloadUiAfterApiInitEnabled()
Returns true if currently the pre loading of the UI is enabled.
|
C |
setApiKey(java.lang.String apiKey)
Changes the api key inside this configuration to the given value.
|
C |
setCameraUploadsEnabled(boolean cameraUploadsEnabled)
If set to false, uploads directly via the camera app are disabled.
|
C |
setCustomCookies(java.util.Map<java.lang.String,java.lang.String> customCookies)
Configures a set of cookies which will be set on the configured base url.
|
C |
setDownloadListener(UnbluDownloadListener downloadListener)
Defines the listener for downloads.
|
C |
setEntryPath(java.lang.String entryPath)
Sets the entry path inside self configuration to the given value.
|
C |
setExternalLinkPatternWhitelist(java.util.List<java.util.regex.Pattern> externalLinkPatternWhitelist)
Sets the list of link patterns that may be opened in the system browser.
|
C |
setInternalUrlPatternWhitelist(java.util.List<java.util.regex.Pattern> internalUrlPatternWhitelist)
Sets the list of URL patterns that may be accessed by the WebView.
|
C |
setLanguage(java.lang.String language)
Sets the language which will be send to the server to define the language used inside the UI.
|
C |
setLoginInformation(java.lang.String username,
java.lang.String password)
Deprecated.
This should no longer be used at all! If the person should be logged in, use
setCustomCookies(Map) with authentication cookies instead |
C |
setNamedArea(java.lang.String namedArea)
Sets the named area for which the configuration is loaded as soon as the api is initializing.
|
C |
setNotificationsEnabled(boolean notificationsEnabled)
Configures if notifications via unblu are enabled or not
|
C |
setPreferencesStorage(UnbluPreferencesStorage preferencesStorage)
Defines the storage implementation to save and retrieve preferences of the SDK.
If it is null, the preferences of the SDK are stored inside the SharedPreferences of the app with Context.MODE_PRIVATE . |
C |
setPreloadUiAfterApiInitEnabled(boolean preloadUiAfterApiInitEnabled)
Enables/disables if the UI should be preloaded, after the unblu api was initialized once.
|
C |
setUnbluBaseUrl(java.lang.String unbluBaseUrl)
Changes the base url inside this configuration to the given value
|
protected UnbluCoreApiConfiguration(@NonNull java.lang.String unbluBaseUrl, @NonNull java.lang.String apiKey)
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).public C setUnbluBaseUrl(@NonNull java.lang.String unbluBaseUrl)
unbluBaseUrl
- The url to the unblu server. (full URL: http(s)://domain:port)@NonNull public java.lang.String getUnbluBaseUrl()
public C setApiKey(@NonNull java.lang.String apiKey)
apiKey
- Your unblu API key (can be retrieved / created on the unblu agent desk).@NonNull public java.lang.String getApiKey()
public C 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 WebView@NonNull public java.util.List<java.util.regex.Pattern> getInternalUrlPatternWhitelist()
public C 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 browser@NonNull public java.util.List<java.util.regex.Pattern> getExternalLinkPatternWhitelist()
public C setEntryPath(@NonNull java.lang.String entryPath)
entryPath
- The entry path used to connect to the unblu server. Typicall value is "/unblu" or "/co-unblu".@NonNull public java.lang.String getEntryPath()
public C 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 boolean isPreloadUiAfterApiInitEnabled()
public C setCustomCookies(@NonNull java.util.Map<java.lang.String,java.lang.String> customCookies)
customCookies
- The cookies which will later be used on the configured base url.public java.util.Map<java.lang.String,java.lang.String> getCustomCookies()
public C setLanguage(@Nullable java.lang.String language)
language
- The language which is set to the server.public java.lang.String getLanguage()
public C setNamedArea(@Nullable java.lang.String namedArea)
namedArea
- The named area meta tag id configured in the agent desk.public java.lang.String getNamedArea()
public C setNotificationsEnabled(boolean notificationsEnabled)
notificationsEnabled:
- if true, notifications are enabled. Otherwise they are disabledpublic boolean isNotificationsEnabled()
public C setCameraUploadsEnabled(boolean cameraUploadsEnabled)
Manifest.permission.READ_EXTERNAL_STORAGE
.
It could be considered as unsafe for security reasons.cameraUploadsEnabled
- If set to true, uploads directly via the camera app are enabled.public boolean isCameraUploadsEnabled()
@Deprecated public C setLoginInformation(@Nullable java.lang.String username, @Nullable java.lang.String password)
setCustomCookies(Map)
with authentication cookies insteadusername
- The username which should be used to loginpassword
- The password which should be used to login@Deprecated @Nullable public java.lang.String getLoginUsername()
setCustomCookies(Map)
with authentication cookies instead@Deprecated @Nullable public java.lang.String getLoginPassword()
setCustomCookies(Map)
with authentication cookies insteadpublic C setPreferencesStorage(@Nullable UnbluPreferencesStorage preferencesStorage)
Context.MODE_PRIVATE
.preferencesStorage
- The storage where the SDK will safe its preferences to.@Nullable public UnbluPreferencesStorage getPreferencesStorage()
public C setDownloadListener(@Nullable UnbluDownloadListener downloadListener)
downloadListener
- The listener which handles all file downloads@Nullable public UnbluDownloadListener getDownloadListener()