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 -> URLReturn 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 -> URLParameters
urlURL to follow for the external user-agent
customParamsAny custom URL query parameters to be passed as URL parameters in the request
browserTypeBrowserType enum to specify the type of external user-agent
browserModeBrowserMode enum to specify the mode of the browser; login, logout, or custom
callbackURLSchemeThe callbackURLScheme to be used for returning to the app. Used in ASWebAuthenticationSession modes
ThrowsBrowserError
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)
View on GitHub