ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
53 stars 54 forks source link

Unhandled Exception: MissingPluginException in iOS simulator #29

Closed sebachuba closed 1 year ago

sebachuba commented 1 year ago

Describe the bug

An error in the iOS simulator occurs when it tries to execute this line…

final response = await FlutterWebAuth2.authenticate(url: url_authorize_compose, callbackUrlScheme: callback_url_scheme);

To Reproduce

Steps to reproduce the behavior:

  1. Go to authenticate view
  2. Click on authenticate CTA
  3. See error on the console... the app crashes

Expected behavior

it should open the 3rd party authenticate page

Screenshots

image

Device (please complete the following information!)

Additional context

Same code in Android simulator, works perfectly

ThexXTURBOXx commented 1 year ago

I am pretty sure that the underlying issue is something like #9 where Apple does some unexpected stuff that no other manufacturer does. Please see if something in https://github.com/ThexXTURBOXx/flutter_web_auth_2#troubleshooting helps. Also, please provide the authentication URL if you may publicly disclose it here.

sebachuba commented 1 year ago

After reading an trying several things, it seems the problem was spaces on the FlutterWebAuth2.authenticate URL... this error only happen in iOS, is it posible to add a validation inside the FlutterWebAuth2.authenticate to response with a error that matches the actual error and not the MissingPluginException?

ThexXTURBOXx commented 1 year ago

Nice to hear that this fixed your issue! However, this is not possible due to Apple's limitations - you are however free to complain in their issue tracker :)