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
51 stars 50 forks source link

IOS: Missing Plugin Implementation #9

Closed agalambas closed 1 year ago

agalambas commented 2 years ago

Describe the bug

When I authenticate to my custom backend in the iOS app, I get this error! Error: MissingPluginException(No implementation found for method authenticate on channel flutter_web_auth_2)

To Reproduce

Steps to reproduce the behavior:

  1. You can run the example given in the package itself

Expected behavior

It should work

Device

Device: iPad Pro 9.7" OS: iOS 15.0.2 flutter_web_auth_2 version: 1.1.2

Additional context

Maybe I am missing some documentation here but I followed everything in the readme

ThexXTURBOXx commented 2 years ago

Hi, could you please try using flutter_web_auth_2 version pinned to exactly 1.1.0 and report back if that worked? :)

agalambas commented 2 years ago

Just tested it and It behaves the same

ThexXTURBOXx commented 2 years ago

Okay, crazy idea: Could you try with version exactly 1.0.0 as well? Because if that one also does not work, there seems to be something fundamentally wrong somewhere since I got confirmation about that one working in the past: https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues/1#issuecomment-1217727401

agalambas commented 2 years ago

Its giving me the same error, so is it probably some setup that I'm doing wrong?

ThexXTURBOXx commented 2 years ago

It seems like something goes wrong on your side, yes. Sadly, I have neither a developer account nor any device by Apple. So, I am not able to test anything there myself properly.

@AndreiRoze, you had tested this package successfully before. Was there something special you needed to do or did it just work out of the box? Also, did you notice anything that broke in the mean time?

AndreiRoze commented 2 years ago

Library works correct, i can recheck it again on monday. For fix that issue try to: 1) flutter clean 2) delete pubspec.lock file (NOT pubspec.yaml) 2) flutter pub get 3) flutter run

If it's doesnt help, could you provide file ios -> Runner -> AppDelegate.swift from your project?

ThexXTURBOXx commented 2 years ago

Thanks for confirming! :)

agalambas commented 2 years ago

I have no idea what was the solution but it is now working in the version 1.0.0, didn't test the latest version yet

Jenry94 commented 2 years ago

i have the same issue :c dont work in ios

ThexXTURBOXx commented 2 years ago

Does 1.0.0 work for you? @Jenry94

Jenry94 commented 2 years ago

don't work for me in any version, i cleaned , update pods, delete and add the plugin and dont work. Only in IOS.

ThexXTURBOXx commented 2 years ago

As already said, alas I cannot test on iOS myself. That's why I rely on fixes by other people in that regard. If someone finds a bug or something else, please propose a PR and I will include it in the next release :)

AndreiRoze commented 2 years ago

I recheck app from example with latest version of library, it's work correct. I use iPad with iOS 15.7(latest)

IMG_0015

If you can, please provide minimal reproducible code sample which doesn't work. Also try some fixes from https://github.com/flutter/flutter/issues/10912 may be it will help you.

ThexXTURBOXx commented 2 years ago

@AndreiRoze Thank you very much for re-confirming this! I am sorry for letting you do all this work 😅 To everyone having a similar issue, please check the generated files if they are correct (according to the issue @AndreiRoze linked above). If nothing helps, try flutter clean and then flutter build <platform> again (be sure to replace <platform> with the specific platform you want to target, e.g. ios). I will close this issue as completed as soon as I mention this in the documentation.

ThexXTURBOXx commented 1 year ago

I tagged this PR as being part of Hacktoberfest. So, if someone is able to fix and properly test this issue, he is one step closer to completing Hacktoberfest 2022 :)

rafalbednarczuk commented 1 year ago

I managed to find one reproducible case on iOS.
It throws the exceptions if the url is invalid, for example having whitespace characters inside url host/port. Steps to reproduce:

  1. clone project and open example/main.dart
  2. Add ` (whitespace) after:` in the url.
    const url = 'http://127.0.0.1: 43823/';
  3. Run app. It throws MissingPluginException which is quite confusing.

On Android, the same case causes to open a blank Android Custom Tab as expected and doesn't throw exception until closing Android Custom Tab which is also as expected.

ThexXTURBOXx commented 1 year ago

@rafalbednarczuk Thank you very much for the information! Since I do not want to assert the correctness of URLs passed into the library (they are just too versatile), I think, I will let this be handled by Apple (in their bad bad way).