UnbluApiConfiguration

@objc
public class UnbluApiConfiguration : NSObject

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

  • Constructs a api configuration

    Declaration

    Swift

    public init(unbluBaseUrl: String, apiKey: String)

    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.)

  • Changes the base url inside the configuration to the given value

    Declaration

    Swift

    public func setUnbluBaseUrl(_ unbluBaseUrl: String) -> UnbluApiConfiguration

    Parameters

    unbluBaseUrl

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

    Return Value

    The configuration to chain multiple calls

  • Returns the currently configured base url

    Declaration

    Swift

    public func getUnbluBaseUrl() -> String

    Return Value

    The currently configured base url

  • Changes the api key inside the configuration to the given value

    Declaration

    Swift

    public func setApiKey(_ apiKey: String) -> UnbluApiConfiguration

    Parameters

    apiKey

    Your unblu API key (can be retrieved / created on the unblu agent desk.)

    Return Value

    The configuration to chain multiple calls

  • Returns the currently configured api key

    Declaration

    Swift

    public func getApiKey() -> String

    Return Value

    The currently configured api key

  • Sets the entry path inside self configuration to the given value. Default is “/unblu”. Do not miss the leading slash!

    Declaration

    Swift

    public func setEntryPath(_ entryPath: String) -> UnbluApiConfiguration

    Parameters

    entryPath

    The entry path used to connect to the unblu server. Typicall value is “/unblu” or “/co-unblu”.

    Return Value

    The configuration to chain multiple calls

  • Returns the currently configured entry path

    Declaration

    Swift

    public func getEntryPath() -> String

    Return Value

    The currently configured entry path

  • Sets 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 func setInternalUrlPatternWhitelist(_ internalUrlPatternWhitelist: [NSRegularExpression]) -> UnbluApiConfiguration

    Parameters

    internalUrlPatternWhitelist

    List of url patterns which may be accessed by the WebView

    Return Value

    The configuration to chain multiple calls

  • Returns the currently configured URL patterns which may be accessed by the WebView

    Declaration

    Swift

    public func getInternalUrlPatternWhitelist() -> [NSRegularExpression]

    Return Value

    The currently configured URL patterns which may be accessed by the WebView

  • Sets the 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, 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.

    Declaration

    Swift

    public func setExternalLinkPatternWhitelist(_ externalLinkPatternWhitelist: [NSRegularExpression]) -> UnbluApiConfiguration

    Parameters

    externalLinkPatternWhitelist

    List of url patterns which may be opened in the system browser

    Return Value

    The configuration to chain multiple calls

  • Returns the currently configured URL patterns which may be opened in the system browser.

    Declaration

    Swift

    public func getExternalLinkPatternWhitelist() -> [NSRegularExpression]

    Return Value

    The currently configured URL patterns which may be opened in the system browser.

  • Enables/disables if the ui should be preloaded, after the unblu api was initialized once.

    Declaration

    Swift

    public func setPreloadUiAfterApiInitEnabled(_ preloadUiAfterApiInitEnabled: Bool) -> UnbluApiConfiguration

    Parameters

    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. If you want to do a pre load of the ui manually, use UnbluApi#preloadUi

    Return Value

    The configuration to chain multiple calls

  • Returns true if currently the pre loading of the ui is enabled

    Declaration

    Swift

    public func isPreloadUiAfterApiInitEnabled() -> Bool

    Return Value

    True if currently the pre loading of the ui is enabled

  • Configures a set of cookies which will be set on the configured base url. It will store only a copy of the given map.

    Declaration

    Swift

    public func setCustomCookies(_ customCookies: [String : String]) -> UnbluApiConfiguration

    Parameters

    customCookies

    The cookies which will later be used on the configured base url

    Return Value

    The configuration to chain multiple calls

  • Returns a copy of the currently configured custom cookies, if they were ever configured.

    Declaration

    Swift

    public func getCustomCookies() -> [String : String]?

    Return Value

    A dictionary of the currently configured custom cookies.

  • Sets the language which 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 func setLanguage(_ language: String?) -> UnbluApiConfiguration

    Parameters

    language

    The language which is set to the server.

    Return Value

    The configuration to chain multiple calls.

  • Returns the currently configured language.

    Declaration

    Swift

    public func getLanguage() -> String?

    Return Value

    The currently configured language.

  • Sets the named area for which the configuration is loaded as soon as the api is initializing. When sessions are started and are put into the queue on the agent desk, they can be filtered by the defined named area. The named area must be configured inside the agent desk.

    Declaration

    Swift

    public func setNamedArea(_ namedArea: String?) -> UnbluApiConfiguration

    Parameters

    namedArea

    The named area meta tag id configured in the agent desk.

    Return Value

    The configuration to chain multiple calls.

  • Returns the currently configured named area.

    Declaration

    Swift

    public func getNamedArea() -> String?

    Return Value

    The currently configured named area.

  • Returns the currently state if notifications are enabled or not

    Declaration

    Swift

    public func isNotificationsEnabled() -> Bool

    Return Value

    The currently state if notifications are enabled or not

  • Configures if notifications via unblu are enabled or not

    Declaration

    Swift

    public func setNotificationsEnabled(_ notificationsEnabled: Bool) -> UnbluApiConfiguration

    Parameters

    notificationsEnabled

    if true, notifications are enabled. Otherwise they are disabled

    Return Value

    The configuration to chain multiple calls

  • Configures the api to use the following login credentials when starting the api. The username and password should match a user which exists on the unblu collaboration server. If either username or password is nil, the login information are not used.

    Declaration

    Swift

    @available(*, deprecated, message: "This should no longer be used at all! If the person should be logged in, use custom cookies with authentication cookies instead")
    public func setLoginInformation(_ username: String?, _ password: String?) -> UnbluApiConfiguration

    Parameters

    username

    The username which should be used to login

    password

    The password which should be used to login

    Return Value

    The configuration to chain multiple calls

  • Returns the username which is used to login agains the unblu collaboration server.

    Declaration

    Swift

    @available(*, deprecated, message: "This should no longer be used at all! If the person should be logged in, use custom cookies with authentication cookies instead")
    public func getLoginUsername() -> String?

    Return Value

    The username used for the login

  • Returns the password which is used to login agains the unblu collaboration server.

    Declaration

    Swift

    @available(*, deprecated, message: "This should no longer be used at all! If the person should be logged in, use custom cookies with authentication cookies instead")
    public func getLoginPassword() -> String?

    Return Value

    The password used for the login

  • Defines the delegate which is invoked for authentication challenges of the internally used webView and file downloads.

    This can be used to do certificate pinning or handle other authentications.

    Declaration

    Swift

    public func setAuthenticationChallengeDelegate(_ delegate: AuthenticationChallengeDelegate?) -> UnbluApiConfiguration

    Parameters

    delegate

    The delegate which should be used for authentication challenges

    Return Value

    The configuration to chain multiple calls

  • Returns the configured delegate for authentication challenges

    Declaration

    Swift

    public func getAuthenticationChallengeDelegate() -> AuthenticationChallengeDelegate?

    Return Value

    Delegate for authentication challenges

  • Defines the storage implementation to save and retrieve preferences of the SDK.

    If it is nil, the preferences of the SDK are stored inside the UserDefaults.standard of the app.

    Declaration

    Swift

    public func setPreferencesStorage(preferencesStorage: UnbluPreferencesStorage?) -> UnbluApiConfiguration

    Parameters

    preferencesStorage

    The storage where the SDK will safe its preferences to.

  • Returns the storage in which unblu saves and restores the preferences of the SDK

    Declaration

    Swift

    public func getPreferencesStorage() -> UnbluPreferencesStorage?

    Return Value

    The configured storage. Nil if the default is used.