BridgeManager
public final class BridgeManagerSingleton-class for managing global setup of subaio-views. Before creating
views, BridgeManager.shared.configure should be invoked and
BridgeManager.shared.language should be assigned.
The manager automatically maintains a valid token and requests new ones using
the onTokenRequired callback whenever necessary.
- 
                  
                  Shared instance of the BridgeManager.DeclarationSwift public static let shared: BridgeManager
- 
                  
                  Language to be used by all BridgeViews as a BCP-47 string. Assigninglanguageautomatically updates all views and triggers a token refetch if configure has already been called. If it is set to nil or not set, views will never exit their loading-state.DeclarationSwift public var language: String? { get set }
- 
                  
                  URL pointing to root of Subaio template, e.g. if template is at https://www.bar.foo/template, then baseUrl should behttps://www.bar.foo.DeclarationSwift public private(set) var baseUrl: URL? { get }
- 
                  
                  Controls whether or not Subaio is allowed to open external URLs. DeclarationSwift public private(set) var allowExternalUrls: Bool { get }
- 
                  
                  Controls whether or not Subaio is allowed to open a share-dialog (should be implemented in the BridgeViewDelegateprotocol asisAttemptingToShare).DeclarationSwift public private(set) var allowShare: Bool { get }
- 
                  
                  Configuration for SSL pinning. DeclarationSwift public private(set) var authenticationChallenger: AuthenticationChallenger? { get }
- 
                  
                  Callback invoked when token needs to be refreshed. Implementations should take care that the supplied completionHandleris always invoked at some point.DeclarationSwift public private(set) var onTokenRequired: TokenRequiredCallback? { get }
- 
                  
                  Custom key-value pairs sent to all BridgeViews. These should be agreed upon before-hand. Useful for runtime theming, light/dark mode etc.DeclarationSwift public var customConfig: [String : String]? { get set }
- 
                  
                  Undocumented DeclarationSwift public init()
- 
                  configure(baseUrl:language: allowExternalUrls: allowShare: authenticationChallenger: onTokenRequired: customConfig: ) Configure the BridgeManagerbefore creatingBridgeViews.DeclarationSwift public func configure( baseUrl: URL, language: String? = nil, allowExternalUrls: Bool? = nil, allowShare: Bool? = nil, authenticationChallenger: AuthenticationChallenger, onTokenRequired: @escaping TokenRequiredCallback, customConfig: [String: String]? = nil )ParametersbaseUrlThe URL where the embedded app is hosted. languageA BCP-47 language tag. The language can be changed on the fly. allowExternalUrlsAllow the embedded app to open arbitrary URLs on the phone. allowShareAllow the embedded app to request a share dialog to share a message. authenticationChallengerHandler for SSL pinning and other connection authentication. onTokenRequiredCallback to request a new token. See Authentication section and platform-specific documentation for details. The callback will be called whenever the BridgeManager needs new token information. customConfigCustom key/values sent to the views. Keys and possible values should be agreed upon between the embedded and host apps. Possible uses are custom theming, dark/light mode and injecting user info. 
- 
                  
                  Undocumented DeclarationSwift public func prewarm()
- 
                  
                  Force a refresh of the token. This is necessary if the user changes authentication status (user logs out, user logs in, user is changed) to ensure that the token (or lack thereof) is correct. Only works after configure has been called and language has been set. If no views are currently open, a new token is fetched when a view is created instead. DeclarationSwift public func refreshToken()
 BridgeManager Class Reference
        BridgeManager Class Reference