Closed mostafaAbdelazim closed 1 year ago
@mostafaAbdelazim add your AppDelegate.swift of your macOS folder
@darwin-morocho Thanks for the quick reply, here's my app delegate
import Cocoa import FlutterMacOS
@NSApplicationMain class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } }
@mostafaAbdelazim first you need to upgrade to flutter_facebook_auth: 5.0.4
next go to
your facebook console > Facebook Login > Settings and make sure you have enabled Login from Devices ,
Login with the JavaScript SDK and finally check that https://www.facebook.com/
is in your Allowed Domains for the JavaScript SDK
Sorry, I forgot add that info in https://facebook.meedu.app/docs/5.x.x/macos
@darwin-morocho I did the above changes, and still the login window is displaying my facebook home feed page after the login is successful
@darwin-morocho I did the above changes, and still the login window is displaying my facebook home feed page after the login is successful
Please check this example https://github.com/darwin-morocho/flutter-facebook-auth/tree/master/examples/with_provider and change with your app id. If the error persists it seems an error in your facebook console configuration
@darwin-morocho I did the above changes, and still the login window is displaying my facebook home feed page after the login is successful
Please check this example https://github.com/darwin-morocho/flutter-facebook-auth/tree/master/examples/with_provider and change with your app id. If the error persists it seems an error in your facebook console configuration
Here you have my configuration
@darwin-morocho Thanks for the detailed help, I've adjusted my facebook console to match yours, now i'm facing a new error (Even tried to login from the provided example and got the same error), here's the full logs:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
@mostafaAbdelazim try with v15.0
instead v14.0
if (kIsWeb || defaultTargetPlatform == TargetPlatform.macOS) {
await FacebookAuth.i.webAndDesktopInitialize(
appId: 'YOUR_APP_ID',
cookie: true,
xfbml: true,
version: "v15.0",
);
}
Also flutter_facebook_auth:5.0.5
has fixed the error Null check operator used on a null value
@darwin-morocho Looking good man, I'm running into new errors,
the login state is successful, i can see the token from the LoginResult object
but when i try to access the token from:
await facebookAuth.accessToken();
the token is null, and getUserData() functions returns empty map since it's using the null accessToken
I believe it's for some reason the accessToken is not written in the secure storage, I've already enabled keychain sharing capability, any help would be appreciated.
keychain sharing capability,
keychain sharing capability needs a developer team. In xcode make sure that keychain sharing capability is really added
@darwin-morocho
@darwin-morocho
check flutter_facebook_auth:5.0.6
expires_in
time on macOS.
NOTE (macOS): keep in mind that this plugin uses the oauth flow facebook login
and in some cases if the graph api doesn't return a long_lived_token
the token stored in the keychain will have a sort live time (80 minutes or less).Great job @darwin-morocho, I've tested version 5.0.6 and it's working as intended, Thank you so much.
I'm having a similar issue where it keeps showing me Can't load URL
. I've tried every single possible configuration on Facebook Console and cannot log in on debug mode.
I'm using:
flutter_facebook_auth: ^6.0.1
What version are you using?
flutter_facebook_auth: ^5.0.1
What OS and version are you using to local deploy your application?
M1 MBA with macOS 13.0
What platforms are you seeing the problem on?
macOS
pubspec.yaml
Describe the Bug
After typing in the correct login info in the facebook login window, the result won't return to my app. Instead, the login window is displaying my facebook home feed page to browse, see screenshots below
Expected Behavior
The login window should close and pass the result back to app window.
To Reproduce
run a flutter app on mac os try to make a login request do the login process on the facebook login window
Relevant log output
No response
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
No response
Info.plist (macOS)