UnbluClientConfiguration
public struct UnbluClientConfiguration
Configuration for the unblu api. Changes to an instance are not considered after the configuration was already given to the UnbluApi#configureApi call. There is a base configuration which needs to be given when constructing it. All other configurations are optional
-
Represents errors relevant to
See moreUnbluClientConfiguration
Declaration
Swift
public enum Error : Swift.Error
-
The url to the unblu server. (full URL: http(s)://domain:port)
Declaration
Swift
public let unbluBaseUrl: String
-
Your unblu API key (can be retrieved / created on the account configuration page.)
Declaration
Swift
public let apiKey: String
-
The storage implementation to save and retrieve preferences of the SDK.
A default implementation is provided by
UserDefaultsPreferencesStorage
, which stores the preferences of the SDK inside the UserDefaults.standard of the appDeclaration
Swift
public let preferencesStorage: UnbluPreferencesStorage
-
Set this to define your own implementation for file downloads within Unblu, or alternatively you can use the default file download handler provided by Unblu,
UnbluDefaultFileDownloadHandler
.Note: If on iOS 10, Unblu will handle the download automatically. This is because we’re unable to retrieve the neccessary cookies to execute potential file downloads from WKWebView before iOS11.
Declaration
Swift
public let fileDownloadHandler: UnbluFileDownloadHandler
-
The entry path which is used to connect to the unblu server. Default is nil.
Note: When the value is nil:
- Unblu will default to “/unblu” for the
UnbluVisitorClient
- Unblu will default to “/app” for the
UnbluAgentClient
Declaration
Swift
public var entryPath: String?
- Unblu will default to “/unblu” for the
-
List of URL patterns that may be accessed by the WebView.
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.
Declaration
Swift
public var internalUrlPatternWhitelist: [NSRegularExpression]
-
The link handler used by Unblu to determine what action to take when an external link is tapped in a conversation.
Declaration
Swift
public let externalLinkHandler: UnbluExternalLinkHandler
-
A Set of
UnbluCookie
objects which will be applied to the requests made by the SDK. Default value is empty.Declaration
Swift
public var customCookies: Set<UnbluCookie>
-
If a language is defined it will be send to the server to define the language used inside the UI. If the language is not explicitly defined, the system language of the device is used. Valid langauge codes to use are defined by the ISO 639-1 standard.
Declaration
Swift
public var language: String?
-
If a named area is defined, it will be set into the context as soon as the api is initialized successfully. This can also be done manually by calling UnbluClienti#namedArea. TODO…
Declaration
Swift
public var namedArea: String?
-
The configuration for the hidden Unblu
UIWindow
Declaration
Swift
public var hiddenUiWindowConfiguration: UnbluHiddenUIWindowConfiguration
-
Delegate which is invoked for authentication challenges of the internally used webView and file downloads.
This can be used to process certificate pinning or handle other authentications.
Declaration
Swift
public var authenticationChallengeDelegate: AuthenticationChallengeDelegate?
-
The
UnbluNotificationInterceptor
to use to intercept and interact with Unblu notification related activity.Declaration
Swift
public var unbluNotificationInterceptor: UnbluNotificationInterceptor?
-
List of additional modules which will be loaded into the
UnbluClient
. Use the register() functions to add a module.Declaration
Swift
private(set) public var modules: [UnbluModule] { get }
-
Constructs a api configuration
Declaration
Swift
public init(unbluBaseUrl: String, apiKey: String, preferencesStorage: UnbluPreferencesStorage, fileDownloadHandler: UnbluFileDownloadHandler, externalLinkHandler: UnbluExternalLinkHandler)
Parameters
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 SDK
fileDownloadHandler
The file download handler used by the CoreSDK to download files.
externalLinkHandler
The link handler to decide policies for external links. Use the
UnbluDefaultExternalLinkHandler
for a basic implementation that can be added to. -
Registers a module which should be used. E.g. call or mobile co-browsing module
Throws
UnbluClientConfiguration.Error.moduleAlreadyRegistered
if the given module is already registeredDeclaration
Swift
public mutating func register(module: UnbluModule) throws
-
Unregister a module which should no longer be used. E.g. call or mobile co-browsing module
Throws
UnbluClientConfiguration.Error.moduleNotRegistered
if the given module is not registeredDeclaration
Swift
public mutating func unregister(module: UnbluModule) throws