create static method
- required WebUri url,
- String? callbackURLScheme,
- WebAuthenticationSessionCompletionHandler? onComplete,
- WebAuthenticationSessionSettings? initialSettings,
Used to create and initialize a session.
url represents a URL with the http or https scheme pointing to the authentication webpage.
callbackURLScheme represents the custom URL scheme that the app expects in the callback URL.
onComplete represents a completion handler the session calls when it completes successfully, or when the user cancels the session.
initialSettings represents initial settings.
Officially Supported Platforms/Implementations:
- iOS WKWebView
- macOS WKWebView
Parameters - Officially Supported Platforms/Implementations:
url: all platformscallbackURLScheme: all platformsonComplete: all platformsinitialSettings: all platforms
Use the PlatformWebAuthenticationSession.isMethodSupported method to check if this method is supported at runtime.
Implementation
static Future<WebAuthenticationSession> create({
required WebUri url,
String? callbackURLScheme,
WebAuthenticationSessionCompletionHandler onComplete,
WebAuthenticationSessionSettings? initialSettings,
}) async {
return WebAuthenticationSession.fromPlatform(
platform: await PlatformWebAuthenticationSession.static().create(
url: url,
callbackURLScheme: callbackURLScheme,
onComplete: onComplete,
initialSettings: initialSettings,
),
);
}