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

[Bug]: MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth_2) #126

Closed
2 tasks done
sirawatGG opened this issue Sep 9, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@sirawatGG
Copy link

sirawatGG commented Sep 9, 2024

Description

Hello there, I received an error message on the client's phone. However, after they updated their iOS to the latest version, they were able to authenticate successfully.

I'm unsure if updating the beta version would resolve this issue. Additionally, I understand that the new approach you mentioned only affects Linux and Windows, and not mobile devices.

Minimal Reproduction

Exception or Error

MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth_2)

Expected Behaviour

Should authen successfully

Screenshots

No response

Additional context

No response

Device

Iphone13

OS

Ios 16.2.0

Browser

Flutter version

3.22.2

flutter_web_auth_2 version

3.1.2

Checklist

  • I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
  • I have provided all the information I can.
@sirawatGG sirawatGG added the bug Something isn't working label Sep 9, 2024
@ThexXTURBOXx
Copy link
Owner

I guess this could be a race condition caused by flutter/flutter#98473
In order to be sure that the correct implementation can be found, DartPluginRegistrant.ensureInitialized() needs to be invoked first, probably.

@sirawatGG
Copy link
Author

Thank you @ThexXTURBOXx very much, I will try

@ThexXTURBOXx
Copy link
Owner

I will close this as this is not really related to flutter_web_auth_2

@oranorr
Copy link

oranorr commented Nov 22, 2024

Hello!
For me there is still an issue: authentication method fails on iOS 15.5 and 16.7, but works perfectly well on higher versions like 18.1.

try {

        result = await FlutterWebAuth2.authenticate(
          url: authUrl,
          callbackUrlScheme: callbackUrl,
        );
      } catch (e) {
        print("Authentification failed or error occured:: $e");
        return const Left(AuthenticationFailure());
      }

Im not quite sure what additional data I should provide.
I did
flutter clean && flutter pub get && run ios
and
cd ios && pod deintegrate && pod install && run ios

Testing on Emulator.

@ThexXTURBOXx
Copy link
Owner

@oranorr This is expected and has nothing to do with this issue. If you want to support older iOS versions, use version 3.x of this package and read the README

@oranorr
Copy link

oranorr commented Nov 22, 2024

@ThexXTURBOXx of course I read README. Tried with 3.0.0 and 2.2.1 versions — still no luck.

@ThexXTURBOXx
Copy link
Owner

Then, please open a new issue and provide more data as required by the template. I am 99% sure that this is not an issue if this package, though, as there have been no recent bug reports regarding such issues and in the past, pretty much all of them have been an issue with the setup.

@oranorr
Copy link

oranorr commented Nov 22, 2024

@ThexXTURBOXx alright, it seems, I found the solution.

The problem was, as per your README:

To use multiple scopes with Google, you need to encode them as a single string, separated by spaces

Having multiple scopes, forming String from them with '$scopes.join(" ")', failed me on earlier iOs. But this comment hinted me to figure out that maybe issue is in spaces.

So I boldly changed
'$scopes.join(" ")',
to
'$scopes.join("%20")',

Which is working perfectly well on iOs 15.5, 17.5 and higher, using even latest 4.0.1 version of this package.

I hope it will help someone.
Thank you for your time

@hungdt2nf
Copy link

@ThexXTURBOXx alright, it seems, I found the solution.

The problem was, as per your README:

To use multiple scopes with Google, you need to encode them as a single string, separated by spaces

Having multiple scopes, forming String from them with '$scopes.join(" ")', failed me on earlier iOs. But this comment hinted me to figure out that maybe issue is in spaces.

So I boldly changed '$scopes.join(" ")', to '$scopes.join("%20")',

Which is working perfectly well on iOs 15.5, 17.5 and higher, using even latest 4.0.1 version of this package.

I hope it will help someone. Thank you for your time

Thanks. This work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants