Closed MichaelFerrier closed 1 year ago
@MichaelFerrier seems to be a conflict with
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
Due to this plugin already insert that script into the DOM. Please try removing it.
I removed that line from the html file and now it works perfectly. Thank you!
May I suggest that in the docs, where it currently states:
::: INFO Since flutter_facebook_auth:^4.2.0 you don't need to add a script code in your index.html. :::
...it may be useful to emphasize that the code required for previous versions must be removed.
What version are you using?
flutter_facebook_auth:5.0.8
What OS and version are you using to local deploy your application?
Windows 11
What platforms are you seeing the problem on?
web
pubspec.yaml
Describe the Bug
As shown in the example code, I initialize the Facebook SDK:
Later, before attempting to log in, I check FacebookAuth.i.isWebSdkInitialized, which is set to true.
Then I attempt to log in:
final facebook.LoginResult result = await facebook.FacebookAuth.instance.login();
This call causes an exception, with the error: 'init not called with valid version'
I tried this with version set to each of the following values, and it always produces that same error. v14.0 v15.0 v15.0.2 v15.1.0
Note that the Facebook login process works fine on iOS and Android; this problem only affects web builds.
Expected Behavior
The call to login() should not result in an exception.
To Reproduce
Relevant log output
flutter doctor -v
Info.plist (iOS)
No response
Podfile (iOS)
No response
AndroidManifest.xml
No response
MainActivity.java
No response
MainActivity.kt
No response
index.html
Info.plist (macOS)
No response