BrowserLauncher
@MainActor
public final class BrowserLauncher : NSObject, BrowserLauncherProtocol
extension BrowserLauncher: ASWebAuthenticationPresentationContextProviding
extension BrowserLauncher: SFSafariViewControllerDelegate
BrowserLauncher class to launch external user-agent for web requests
-
Static shared instance of current Browser object
Declaration
Swift
@MainActor public static var currentBrowser: BrowserLauncherProtocol
-
Boolean indicator whether or not current Browser object is in progress
Declaration
Swift
@MainActor private(set) public var isInProgress: Bool { get }
-
Resets the browser state
Declaration
Swift
@MainActor public func reset()
-
launch(url:
AsynchronousbrowserType: callbackURLScheme: ) Launches external user-agent for web requests
Declaration
Swift
@MainActor public func launch(url: URL, browserType: BrowserType, callbackURLScheme: String) async throws -> URL
Return Value
URL of the external user-agent
-
Launches external user-agent for web requests
Declaration
Swift
@MainActor public func launch(url: URL, customParams: [String: String]? = nil, browserType: BrowserType = .authSession, browserMode: BrowserMode = .login, callbackURLScheme: String) async throws -> URL
Parameters
url
URL to follow for the external user-agent
customParams
Any custom URL query parameters to be passed as URL parameters in the request
browserType
BrowserType enum to specify the type of external user-agent
browserMode
BrowserMode enum to specify the mode of the browser; login, logout, or custom
callbackURLScheme
The callbackURLScheme to be used for returning to the app. Used in ASWebAuthenticationSession modes
Throws
BrowserError
Return Value
URL of the external user-agent
-
Declaration
Swift
@MainActor public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor
-
Declaration
Swift
nonisolated public func safariViewControllerDidFinish(_ controller: SFSafariViewController)
-
Declaration
Swift
nonisolated public func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo URL: URL)