UnbluApiConfiguration

public struct UnbluApiConfiguration

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

  • 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 unblu agent desk.)

    Declaration

    Swift

    public let apiKey: String
  • The storage implementation to save and retrieve preferences of the SDK.

    A default implementation can be used by creating UserDefaults, which stores the preferences of the SDKinside the UserDefaults.standard of the app

    Declaration

    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 “/unblu”.

    Declaration

    Swift

    public var entryPath: String
  • 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]
  • List of link patterns that may be opened in the system browser.

    Those are typical links from the chat which are clicked by the user. The following patterns are added per default, but can be overridden.

    • ^\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.

    Declaration

    Swift

    public var externalLinkPatternWhitelist: [NSRegularExpression]
  • 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 show. If you want to do a pre load of the ui manually, use UnbluApi#preloadUi

    Declaration

    Swift

    public var preloadUiAfterApiInitEnabled: Bool
  • 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.

    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 UnbluApi#setNamedArea.

    Declaration

    Swift

    public var namedArea: String?
  • The configuration for the main UnbluUIWindow (i.e. the UIWindow that contains displayable content like the WebView)

    Declaration

    Swift

    public var uiWindowConfiguration: UnbluUIWindowConfiguration
  • The configuration for the hidden UnbluUIWindow

    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?
  • List of additional modules which will be loaded into the UnbluCoreSDK. 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)

    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.

  • Registers a module which should be used. E.g. call or co-browsing module

    Declaration

    Swift

    public mutating func register(module: UnbluModule)
  • Registers multiple modules which should be used. E.g. call or co-browsing module

    Declaration

    Swift

    public mutating func register(modules: [UnbluModule])

    Parameters

    modules

    The modules to register

  • Unregister a module which should no longer be used. E.g. call or co-browsing module

    Declaration

    Swift

    public mutating func unregister(module: UnbluModule)
  • Returns and array of IAbstractBaseModule created using the given driver. Internal use only.

    Declaration

    Swift

    public func abstractModules(with driver: MobileDeviceDriverCoreApi) -> [IAbstractBaseModule]