create method
- @SupportedPlatforms.new(platforms: [IOSPlatform(), MacOSPlatform()])
- 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
@SupportedPlatforms(platforms: [IOSPlatform(), MacOSPlatform()])
Future<PlatformWebAuthenticationSession> create({
required WebUri url,
String? callbackURLScheme,
WebAuthenticationSessionCompletionHandler onComplete,
WebAuthenticationSessionSettings? initialSettings,
}) {
throw UnimplementedError(
'create is not implemented on the current platform',
);
}