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 UnbluClientConfiguration

    See more

    Declaration

    Swift

    public enum Error : Swift.Error
  • Represents an access token for authentication

    See more

    Declaration

    Swift

    public struct AccessToken
  • The url to the unblu server. (full URL: http(s)://domain:port)

    Declaration

    Swift

    public let unbluBaseUrl: String
  • The initial OAuth 2.0 token received from an identity provider, which will pass to service worker and used in the authorization header. Bearer Token Usage: https://datatracker.ietf.org/doc/html/rfc6750

    Declaration

    Swift

    public var ouathToken: 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 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 nil.

    Note: When the value is nil:

    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]
  • 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>
  • JSON Web Token object which will be applied to start an Unblu authentication session. It can only be used to create a visitor authentication session. For agent session it is ignored

    Declaration

    Swift

    public var accessToken: AccessToken?
  • 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?
  • The name of the resource for the icon image that will be displayed for the provider in the incoming call user interface The resource name must be initialized in the AppDelegate, since there must be only one CXProvider to which this name is passed, must also be initialized in AppDelegate

    Declaration

    Swift

    public static var callKitProviderIconResourceName: String?
  • The unbluPushNotificationVersion

    NotEncrypted - Notifications are not encrypted, PushKit notifications are supported Encrypted - All notifications, including PushKit, are encrypted EncryptedService - All notifications, including PushKit, are encrypted. Using this version, a notification service extension must be added where notifications will be decrypted using the UnbluEncryptedNotificationServiceHelper.

    See more

    Declaration

    Swift

    public enum PushNotificationVersion : Int
  • Declaration

    Swift

    public var unbluPushNotificationVersion: PushNotificationVersion
  • 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 registered

    Declaration

    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 registered

    Declaration

    Swift

    public mutating func unregister(module: UnbluModule) throws