Open
Description
Description
When using flutter_web_auth_2 from an iOS app extension, the plugin fails because it tries to obtain the rootViewController using UIApplication.shared.delegate?.window??.rootViewController, which is nil in extension contexts. This causes the authentication session to throw an ACQUIRE_ROOT_VIEW_CONTROLLER_FAILED error, even though the extension itself has access to the appropriate UIViewController.
There is currently no way to manually provide or override the presentationContextProvider used by ASWebAuthenticationSession from what I see, is there any existing solution to this issue?
To Reproduce
// In an app extension using flutter_web_auth_2:
await FlutterWebAuth2.authenticate(
url: 'https://example.com/auth',
callbackUrlScheme: 'myapp',
);
Device (please complete the following information!)
- Device: iPhone 16 simulator
- OS: iOS 18.2
- Browser: Safari
flutter_web_auth_2
version: ^5.0.0-alpha.0