Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingPluginException (MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth)) #119

Open
bgomez-signa opened this issue May 17, 2022 · 5 comments

Comments

@bgomez-signa
Copy link

bgomez-signa commented May 17, 2022

Hi everyone,

I'm getting this error when trying to authenticate on a 3rd party server on iOS platform. On Android same authentication workflow is working just fine.

The error is a little misleading, because the plugin does contain both the method channel and the native "authenticate()" method implementation for iOS on its corresponding Swift class.

Using flutter_web_auth: ^0.4.1

Any help will be appreciated.

Thanks!

@LinusU
Copy link
Owner

LinusU commented May 29, 2022

It seems like something has gone wrong when generating the iOS part of your project. This library has support for both iOS and Android.

Unfortunately I don't have too much experience with the inner workings of Flutter. I would recommend googling generic MissingPluginException errors and see if there are any solutions...

@koenmuilwijk
Copy link

koenmuilwijk commented Jan 23, 2023

This might happen when passing in a url which cannot be parsed into a Uri on iOS. Parsing the url string in a Uri object is done in the same if check as checking the called method name which results in this very confusing error message.

In my case I had an encoding error in the querystring which worked fine on Android but iOS didn't want to parse the url into an Uri. It took me a little while that the incorrect url caused the MissingPluginException... Would have been nice to get a more clear error message.

@LinusU
Copy link
Owner

LinusU commented Feb 1, 2023

@koenmuilwijk that's very interesting, could you link the code where this is happening?

I would be happy to accept a PR for a better error message!

@koenmuilwijk
Copy link

@LinusU it's in SwiftFlutterWebAuthPlugin on line 17.

if call.method == "authenticate",
           let arguments = call.arguments as? Dictionary<String, AnyObject>,
           let urlString = arguments["url"] as? String,
           let url = URL(string: urlString),   // <---- if this fails it will return result(FlutterMethodNotImplemented) on line 90
           let callbackURLScheme = arguments["callbackUrlScheme"] as? String,
           let preferEphemeral = arguments["preferEphemeral"] as? Bool
        {

I currently don't have access to a working XCode environment, so I'm afraid I can't create a PR for this.

@meet7-sagar23
Copy link

Hello @LinusU, can you please find a working solution for the same? I've got a major dependency on the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants