Git Product home page Git Product logo

flutter_login_facebook's People

Contributors

atrope avatar drvnm avatar ggichure avatar greymag avatar hamzaalmahdi avatar ivezhov avatar leobasilio avatar mean-cj avatar rogiervandenberg avatar secondstream avatar spiritinlife avatar vabiel avatar yurinagy01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_login_facebook's Issues

README improvements

Need to be more clarify:

  • Release hash key
  • Add some information about testers of the app

See #18

Facebook SDK initialisation error

Hi, thanks for this amazing plugin, really appreciate your contribution to the community.

I followed the setup instructions that were provided in readme, for iOS everything went smooth, no hiccups at all. But for Android, app is crashing with the following -

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.

Any idea why this will happen? I was hoping not to add the separate dependency in Android project, let me know if I need to do so.

Thanks

Unable to logout from facebook

Hi,

The code
await widget.plugin.logOut();
does not log the user out. (this code is taken from link)

If I click on login button after clicking logout button, then a pop-up window appears for a second and I get the previous user automatically(i.e. it didn't logout the previous user).

I have noticed that if I log out from the Facebook app then the user in the app is also logged out.(without clicking logout button)

Please help me fix this bug, it is urgent!

Summary:
The logout code given in the example doesn't actually log the user out because of which when we click on the login button the next time it automatically returns the previous logged in user.

Thank you!

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

By adding flutter_login_facebook: ^1.0.1 , the following dependencies stop working and throw a similar error

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

Effected dependencies
path_provider: ^2.0.2
sqflite
moor_flutter: ^4.0.0

Could not build the precompiled application for the device.

flutter_login_facebook: ^1.1.0
flutter : 2.2.3

I don't know about ios.
wecom-temp-0a12184f5937dfa255ec5baff640e607

The following is the log:

Xcode's output:
↳
    rongcloud_im_plugin-dkbpdldttkdtsjbcxqvkegqoshys
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:148:22: warning:
    'start(completionHandler:)' is deprecated: This method is deprecated and will be removed in the next major release. Please use `startWithCompletion:` instead`
            graphRequest.start(completionHandler: { (connection, res, error) -> Void in
                         ^
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:178:61: error: type 'Profile' has
    no member 'PictureMode'
                    let url = profile.imageURL(forMode: Profile.PictureMode.normal,
                                                        ~~~~~~~ ^~~~~~~~~~~
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:199:11: error: extra trailing
    closure passed in call
            ) { res in
              ^~~~~~~~
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:197:26: error: cannot convert value
    of type '[Permission]' to expected argument type '[String]'
                permissions: permissions,
                             ^
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:197:26: note: arguments to generic
    parameter 'Element' ('Permission' and 'String') are expected to be equal
                permissions: permissions,
                             ^
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:244:34: error: value of type
    'AccessToken' has no member 'permissions'
                "permissions": token.permissions.map {item in item.name},
                               ~~~~~ ^~~~~~~~~~~
    /Users/lizhuoyuan/.pub-cache/hosted/pub.flutter-io.cn/flutter_login_facebook-1.1.0/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:245:42: error: value of type
    'AccessToken' has no member 'declinedPermissions'
                "declinedPermissions": token.declinedPermissions.map {item in item.name},
                                       ~~~~~ ^~~~~~~~~~~~~~~~~~~
    rongcloud_im_plugin-dkbpdldttkdtsjbcxqvkegqoshys
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

Could not build the precompiled application for the device.

Error launching application on iPhone.

[Question] How to interact with firebase_auth?

Hi, i am using firebase auth in my flutter project, i am looking solution for facebook login. Can i use this plugin with firebase_auth?

BTW, i am very appreciate your Readme guide of the plugin, it's very helpful for me, thank you very much!

No platform was specified cocoapods error

I'm getting the following error when adding flutter_login_facebook to my pubspec.yaml:

[!] Automatically assigning platform iOS with version 8.0 on target Runner because no platform was specified. Please specify a
platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

After creating a new flutter project, the only change I made was adding flutter_login_facebook: ^0.2.1 to my pubspec.yaml file. Any ideas on what's happening?

Unable to login with a differente account after logout

I'm trying to login with a different facebook account after logging out, but every time I Login, the logIn method asks to continue with the previous logged in user, without asking for credentials of credentials, not even for the previously logged in user.

The accessToken hasCode is different before and after loguOut, but the app always tries to re-login with the same account.

The only way for me to login in with a different account is IF i delete Chrome's cache.

Snippet

  logout() async {

    // Sign Out from Facebook
    if (await isFacebookSignedIn()) {
      print("Facebook Token Before: ${facebookSignIn.accessToken.hashCode}");
      print("Sign Out from Facebook");
      await facebookSignIn.logOut();
      print("Facebook Token After: ${facebookSignIn.accessToken.hashCode}");
    }

    // Log Out from Firebase
    print("Firebase User Before: ${authService.currentUser.hashCode}");
    print("Log out from Firebase");
    authService.logOut();
    print("Firebase User After: ${authService.currentUser.hashCode}");
  }

Log Trace

flutter: Facebook - Token Before: FacebookAccessToken(token: EAAM1VXnjookBADNaf#####WQBipMCZBXCRrAqz1QZATOKR5nOjOeR78IcOht1gDAsVg1EYZAeccBFKb4GWnXGfjVXT3H1P3dilV95RA5QdZAF9IFU6JzgQCI8sGEp#####KyaO5YAHadJnVzEOKZAxZBmo23YeZAiU7qr4#####Rts7, userId: 10158454090076589, expires: 2021-07-30 21:12:05.921Z, permissions: [public_profile, email, openid], declinedPermissions: [])
flutter: Facebook - Sign Out
flutter: Facebook - Token After: null
flutter: Firebase - User Before: User(displayName: Angel Perez, email: #####hotmail.com, emailVerified: false, isAnonymous: false, metadata: UserMetadata(creationTime: 2021-05-26 19:57:58.311, lastSignInTime: 2021-05-31 16:12:07.392), phoneNumber: null, photoURL: https://graph.facebook.com/10158#####6589/picture, providerData, [UserInfo(displayName: ##### ##### email: #####hotmail.com, phoneNumber: null, photoURL: https://graph.facebook.com/10158*****6589/picture, providerId: facebook.com, uid: 10158#####6589)], refreshToken: , tenantId: null, uid: fCpoE9zN#####HtJq4ij2)
flutter: Firebase - Log Out
flutter: Firebase - User After: null

Picture
image

invalid result on get email

My ios App get this error
Get user email error: PlatformException(UNKNOWN, Invalid result on get email: (Function), null, null)

var login = await facebookLogin.logIn(permissions: [
  FacebookPermission.publicProfile,
  FacebookPermission.email,
]);

if (Platform.isAndroid) {
  login = await facebookLogin.expressLogin();
}
switch (login.status) {
  case FacebookLoginStatus.success:

 await facebookLogin.getUserProfile();
    final token = await facebookLogin.accessToken;
    debugPrint("token $token");
    if(token!.permissions.contains(FacebookPermission.email.name)){
    final _email = await facebookLogin.getUserEmail();
    debugPrint("email $_email");

    }

    break;
  case FacebookLoginStatus.cancel:
    ToastHelper.showShort("Login cancelled by the user.");

    break;
  case FacebookLoginStatus.error:
    ToastHelper.showErrorLong(
        'Something went wrong with the login process.\n'
        'Here\'s the error Facebook gave us: ${login.error}');

    break;

}

Why we should put FaceBookLogin object in the widget class?

Hi.
I wanted to propagate final facebook = FacebookLogin(debug: true,) with provider but seems we must put it in Widget class of Stateful widget to make it work.
Is there any reason?
Should I do anything to make it work in another place?

login dialog is not showing

I took code from an example but login dialog does not come up

final fb = FacebookLogin();
    final facebookLoginResult = await fb.logIn(permissions: [
      FacebookPermission.publicProfile,
      FacebookPermission.email,
    ]);

just nothing happens...

Submission to appstore with this plugin complains that a deprecated UIWebView API is being used

Hi - just testing out the plugin on both iOS and Android. In both versions - the plugin works perfectly. Tested in both Java/Kotlin built projects and also OBJ-C/Swift built projects.

I did have some issues with my app building properly in iOS and needed to POD install FBSDKCoreKit/LoginKit 7.0.0, then flutter clean and then build again...

Looking in podfile.lock, appears to use latest 7.0.0 API :-

 FBSDKCoreKit (7.0.0):
    - FBSDKCoreKit/Basics (= 7.0.0)
    - FBSDKCoreKit/Core (= 7.0.0)
  - FBSDKCoreKit/Basics (7.0.0)
  - FBSDKCoreKit/Core (7.0.0):
    - FBSDKCoreKit/Basics
  - FBSDKLoginKit (7.0.0):
    - FBSDKLoginKit/Login (= 7.0.0)
  - FBSDKLoginKit/Login (7.0.0):
    - FBSDKCoreKit (~> 7.0.0)

So - whats the issue? Well , submitting an app built with this plugin - I get deprecated warnings :

Dear Developer,

We identified one or more issues with a recent delivery for your app, "SaxySusie4You" 0.0.14 (2). Please correct the following issues, then upload again.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. 
Instead, use WKWebView for improved security and reliability. Learn more 
(https://developer.apple.com/documentation/uikit/uiwebview).

[Question] About CI/CD Build for key hashes

I don't understand what this meant

⚠️ Important! You should add key hashes for every build variants. E.g. if you have CI/CD which build APK for testing with it's own cerificate (it may be auto generated debug cetificate or some another) than you should add it's key too.

Do you have an example project(specifically in codemagic) that generates key hashes every build?

How to handle invalid access token on facebook

hi guys,

I'm getting this error on Android
W/libEGL (15668): EGLNativeWindowType 0x6f2af42450 disconnect failed
E/GraphResponse(15668): {HttpStatus: 400, errorCode: 190, subErrorCode: 460, errorType: OAuthException, errorMessage: Error validating access token: The session has been invalidated because the user changed their password or Facebook has changed the session for security reasons.}

After a bit of investigation. ,I've found this on the FB dev website.

How-To: Handle expired access tokens
One of the most frequently asked for “How-To” requests from developers is how to handle invalid access tokens. Access tokens for users can become invalid due to various reasons. In most cases, they can expire if it’s past the time specified by the ‘expires’ field (by default access token have a 2 hour lifetime). What many developers do not realize is that an access token can also expire if a user changes her password, logs out or if she de-authorizes the app via the App Dashboard. It is very important that your apps handle such situations. If your access token expires, you need to reacquire a valid access token.

The solution is written in PHP. I think you guys should integrate this because otherwise you can't login anymore to the app.
Have a look and let me know.

plugin to the V2 embedding

The plugins `flutter_facebook_login, use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

'FBSDKCoreKit' has a minimum deployment target of iOS 11.0

Build failed on iOS

Compiling for iOS 9.0, but module 'FBSDKCoreKit' has a minimum deployment target of iOS 11.0

My Podfile.lock

...
  - FBSDKCoreKit (7.1.1):
    - FBSDKCoreKit/Basics (= 7.1.1)
    - FBSDKCoreKit/Core (= 7.1.1)
  - FBSDKCoreKit/Basics (7.1.1)
  - FBSDKCoreKit/Core (7.1.1):
    - FBSDKCoreKit/Basics
  - FBSDKLoginKit (7.1.1):
    - FBSDKLoginKit/Login (= 7.1.1)
  - FBSDKLoginKit/Login (7.1.1):
    - FBSDKCoreKit (~> 7.1.1)
...
  - flutter_login_facebook (0.1.0):
    - FBSDKLoginKit (~> 7.0)
    - Flutter

It works fine if changing platform to 11.0 in ios/flutter_login_facebook.podspec

-  s.platform = :ios, '9.0'
+  s.platform = :ios, '11.0'

No webview in version 0.3.0

Worked out of the gate until version 0.3.0

Since version 0.3.0, the login process kicks off a device browser (instead of a dialog type webview in previous versions). After successfully logging in, the callbacks to cancel, success or error are not made and a popup is showed in the Chrome browser to leave the page. A black screen is the result.

Happens on Android device. I have seen other Facebook login packages that force some kind of loginBehavior (webview).
Curious about your thoughts to get the old behavior back in the new SDK. Thanks in advance.

I have downgraded for now.

Won't compile for iOS

I am using latest version and it won´t compile on iOS.

Errors:

/pub.dartlang.org/flutter_login_facebook-1.0.1/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:178:61: Type 'Profile' has no member 'PictureMode'

/pub.dartlang.org/flutter_login_facebook-1.0.1/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:199:11: Extra trailing closure passed in call

/pub.dartlang.org/flutter_login_facebook-1.0.1/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:197:26: Cannot convert value of type '[Permission]' to expected argument type '[String]'

/pub.dartlang.org/flutter_login_facebook-1.0.1/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:244:34: Value of type 'AccessToken' has no member 'permissions'

/pub.dartlang.org/flutter_login_facebook-1.0.1/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:245:42: Value of type 'AccessToken' has no member 'declinedPermissions'

Flutter doctor -v:

[✓] Flutter (Channel stable, 2.2.2, on Mac OS X 10.15.7 19H1217 darwin-x64, locale pt-BR)
• Flutter version 2.2.2 at /Users/danvilela/flutter
• Framework revision d79295af24 (9 days ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/danvilela/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.57.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.23.0

[✓] Connected device (2 available)
• iPhone 8 (mobile) • 68012A62-7148-434F-BCE6-79C6B9CC9875 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome
91.0.4472.106

• No issues found!

AX Lookup problem

I get the following error:

[AXRuntimeCommon] Unknown client: Runner [tcp] tcp_input [C8.1:3] flags=[R] seq=1710933642, ack=0, win=0 state=CLOSED rcv_nxt=1710933642, snd_una=2129208749 [tcp] tcp_input [C8.1:3] flags=[R] seq=1710933642, ack=0, win=0 state=CLOSED rcv_nxt=1710933642, snd_una=2129208749 [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1846 ( 0 AXRuntime 0x00000001a237f330 4054936E-248B-3ADB-81B1-0AA941922C9C + 365360 1 AXRuntime 0x00000001a232a150 _AXGetPortFromCache + 560 2 AXRuntime 0x00000001a232b7e0 AXUIElementPerformFencedActionWithValue + 464 3 UIKit 0x00000001ce9da324 6CE533D0-61DA-329E-B111-05CD5C09CC2E + 901924 4 libdispatch.dylib 0x0000000182799a54 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 10836 5 libdispatch.dylib 0x000000018279b7ec FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 18412 6 libdispatch.dylib 0x00000001827a2fd4 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 49108 7 libdispatch.dylib 0x00000001827a3bd0 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 52176 8 libdispatch.dylib 0x00000001827ae48c FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 95372 9 libsystem_pthread.dylib 0x00000001ce6e67a4 _pthread_wqthread + 276 10 libsystem_pthread.dylib 0x00000001ce6ed74c start_wqthread + 8 ) [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1846 ( 0 AXRuntime 0x00000001a237f330 4054936E-248B-3ADB-81B1-0AA941922C9C + 365360 1 AXRuntime 0x00000001a232a150 _AXGetPortFromCache + 560 2 AXRuntime 0x00000001a232b7e0 AXUIElementPerformFencedActionWithValue + 464 3 UIKit 0x00000001ce9da324 6CE533D0-61DA-329E-B111-05CD5C09CC2E + 901924 4 libdispatch.dylib 0x0000000182799a54 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 10836 5 libdispatch.dylib 0x000000018279b7ec FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 18412 6 libdispatch.dylib 0x00000001827a2fd4 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 49108 7 libdispatch.dylib 0x00000001827a3bd0 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 52176 8 libdispatch.dylib 0x00000001827ae48c FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 95372 9 libsystem_pthread.dylib 0x00000001ce6e67a4 _pthread_wqthread + 276 10 libsystem_pthread.dylib 0x00000001ce6ed74c start_wqthread + 8 ) [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1846 ( 0 AXRuntime 0x00000001a237f330 4054936E-248B-3ADB-81B1-0AA941922C9C + 365360 1 AXRuntime 0x00000001a232a150 _AXGetPortFromCache + 560 2 AXRuntime 0x00000001a232b7e0 AXUIElementPerformFencedActionWithValue + 464 3 UIKit 0x00000001ce9da324 6CE533D0-61DA-329E-B111-05CD5C09CC2E + 901924 4 libdispatch.dylib 0x0000000182799a54 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 10836 5 libdispatch.dylib 0x000000018279b7ec FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 18412 6 libdispatch.dylib 0x00000001827a2fd4 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 49108 7 libdispatch.dylib 0x00000001827a3bd0 FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 52176 8 libdispatch.dylib 0x00000001827ae48c FFC93E7E-8360-32A0-9EB5-FE3761B8C90A + 95372 9 libsystem_pthread.dylib 0x00000001ce6e67a4 _pthread_wqthread + 276 10 libsystem_pthread.dylib 0x00000001ce6ed74c start_wqthread + 8 )

// Facebook
  Future fbSignIn() async {
    final fb = FacebookLogin();

// Log in
    final res = await fb.logIn(permissions: [
      FacebookPermission.publicProfile,
      FacebookPermission.email,
    ]);

// Check result status
    switch (res.status) {
      case FacebookLoginStatus.success:
        // Logged in

        // Send access token to server for validation and auth
        final FacebookAccessToken accessToken = res.accessToken;
        final AuthCredential authCredential =
            FacebookAuthProvider.credential(accessToken.token);
        final result =
            await FirebaseAuth.instance.signInWithCredential(authCredential);

        // Get profile data
        final profile = await fb.getUserProfile();
        print('Hello, ${profile.name}! You ID: ${profile.userId}');

        // Get user profile image url
        final imageUrl = await fb.getProfileImageUrl(width: 100);
        print('Your profile image: $imageUrl');

        // Get email (since we request email permission)
        final email = await fb.getUserEmail();
        // But user can decline permission
        if (email != null) print('And your email is $email');

        break;
      case FacebookLoginStatus.cancel:
        // User cancel log in
        break;
      case FacebookLoginStatus.error:
        // Log in failed
        print('Error while log in: ${res.error}');
        break;
    }
  }
}

The login with firebase ist working but I got this error. Any ideas?

No Email on Android / Graph API

I have problems accessing the email from the access token, both on the server side and on android. However, it does work on iOS.

I am following the plain example from your code and I can see in my facebook settings that the app has access to the email (and this is correct, as it works on iOS).

I digged into the iOS and Android code and can't spot the difference.

Is this a known problem?

PlatformException(INTERRUPTED, Waiting login result was been interrupted!, null)

Getting following platform Exception error on emulator after clicking on continue .
Screenshot_1600183039
.Please guide how to resolve this.

I/flutter ( 7427): PlatformException(INTERRUPTED, Waiting login result was been interrupted!, null)
I/flutter ( 7427): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:572:7)
I/flutter ( 7427): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:161:18)
I/flutter ( 7427): <asynchronous suspension>
I/flutter ( 7427): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
I/flutter ( 7427): #3      FacebookLogin.logIn (package:flutter_login_facebook/src/facebook_login.dart:154:10)
I/flutter ( 7427): #4      FacebookGraph.newInitiateOAuthLogin (package:spock/clients/facebook.dart:42:51)
I/flutter ( 7427): #5      _LogInRouteState._continueWithFacebook (package:spock/routes/login/login.dart:186:5)
I/flutter ( 7427): #6      _LogInRouteState.build.<anonymous closure>.<anonymous closure> (package:spock/routes/login/login.dart:115:23)
I/flutter ( 7427): #7      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19)
I/flutter ( 7427): #8      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38)
I/flutter ( 7427): #9      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
I/flutter ( 7427): #10     TapGestureRecogniz

Facebook Logout Issue

Facebook is not logging out properly even after clicking the logout button. I have used the following code:

    await facebookLogin.logOut();
    await _firebaseAuth.signOut();

I have also tried deleting the user from the firebase account, but when I clicked on the SIgn in button again, it added the same user in firebase. I guess it is because I have the Facebook app installed on my phone, I have tried deleting the Facebook app and it worked properly.

P.S I am using android.

logIn() doesn't complete when dialog dismissed on iPad

Hello i don't have issues on the phones but
on iPad the FB SDK shows a dialog instead of full screen.

When user taps on the outside area of the dialog, the dialog dismisses but
the logIn method doesn't return and is stuck.

Tapping on the Cancel button works. But we should support the case that user will
tap on the outside of the dialog to dismiss.

Regards
Hiroshi

Expose the GraphAPI endpoint

Couldn't be a good idea to expose a generic method to make request to the GraphAPI using the GraphRequest?

Primarily, this will let the managing of the token on the native SDK side; and because that any request has to be done with a token, which the login is already providing and holding, this will ease the implementation of other Facebook's non-existent components. ie. PagesAPI, EventsAPI, etc.

Plugin only work when there is no FB app.

Hey, recently I have release my app on Play store and eariler before release, I was testing on my phone(with no FB app install) and now, my colleague are saying FB sign_in is not working.
And when I check into their phone, I found that the issue was because of the FB app. Then, I uninstall the FB app and after that FB sign_in was working. Following is the Error when sign_in was done when FB app was install.

image

Note - FB app (Facebook app)

[Question] Valid OAuth Redirect URIs without using OAuth gives error

I have followed the README and the article https://medium.com/@greymag/add-facebook-login-in-your-flutter-app-5172b034aa7d . But it seems facebook is giving me an error Can't Load URL: The domain of this URL ins't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app Settings. I'm currently on my Mobile Data plan and I'll add a screenshot later.

I have Firebase installed in my app for google maps, but may be the cause of Facebook's OAuth Redirect URI. Should I set up my Firebase Auth as well?

Use of deprecated API - Android

Note: C:\Users\Tomas\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\flutter_login_facebook-1.2.0\android\src\main\java\ru\innim\flutter_login_facebook\FlutterLoginFacebookPlugin.java uses or overrides a deprecated API.

Fail to build Apk

Hey, I am getting below error message when I am building apk-

command used- flutter build apk --target-platform=android-arm64 --no-tree-shake-icons or flutter build apk --split-per-abi --no-tree-shake-icons

version- flutter_login_facebook 0.4.0+1

FAILURE: Build failed with an exception.                                                                           
                                                                                                                   
* What went wrong:                                                                                                 
A problem was found with the configuration of task ':flutter_login_facebook:compileReleaseJavaWithJavac'.          
> File '/home/yash/Programming/flutter/appName/build/flutter_login_facebook/intermediates/annotation_processor_list/release/annotationProcessors.json' specified for property 'processorListFile' does not exist.
                                                                                                                   
* Try:                                                                                                             
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                                                                   
* Get more help at https://help.gradle.org 

Please let me know if you need more info.

Cannot run the example project.

I've tried to clone the package and run the example project but I've failed to do so. Below is the error I get:

Xcode's output:
↳
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:178:61: error:
    type 'Profile' has no member 'PictureMode'
                    let url = profile.imageURL(forMode: Profile.PictureMode.normal,
                                                        ~~~~~~~ ^~~~~~~~~~~
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:199:11: error:
    extra trailing closure passed in call
            ) { res in
              ^~~~~~~~
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:197:26: error:
    cannot convert value of type '[Permission]' to expected argument type '[String]'
                permissions: permissions,
                             ^
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:197:26: note:
    arguments to generic parameter 'Element' ('Permission' and 'String') are expected to be equal
                permissions: permissions,
                             ^
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:243:34: error:
    value of type 'AccessToken' has no member 'permissions'
                "permissions": token.permissions.map {item in item.name},
                               ~~~~~ ^~~~~~~~~~~
    /Users/sametsahin/work/flutter-projects/flutter-mobile-projects/flutter_login_facebook/ios/Classes/SwiftFlutterLoginFacebookPlugin.swift:244:42: error:
    value of type 'AccessToken' has no member 'declinedPermissions'
                "declinedPermissions": token.declinedPermissions.map {item in item.name},
                                       ~~~~~ ^~~~~~~~~~~~~~~~~~~
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99.
    (in target 'Flutter' from project 'Pods')

Could not build the precompiled application for the device.

Error launching application on Elif iPhone’u.

Output of flutter doctor -v

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B50 darwin-x64, locale en)
    • Flutter version 1.22.5 at /Users/sametsahin/work/flutter
    • Framework revision 7891006299 (4 days ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/sametsahin/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[!] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

Support Firebase Auth

Hey guys, could you provide a version of your dependency to be used with Firebase Auth?
I'm using this code for Google SignIn and signout, but FB has different classes and methods and I'm not sure how to integrate with flutter.
Sorry, I've started with Flutter and Dart only for the past 4 weeks.

class AuthService {
  final FirebaseAuth _auth = FirebaseAuth.instance;
  final GoogleSignIn _googleSignIn = new GoogleSignIn();

  // Create user object based on FirebaseUser
  User _userFromFirebaseUser(FirebaseUser user) {
    return user != null ? User(uid: user.uid) : null;
  }

  // Auth change user stream
  Stream<User> get user {
    return _auth.onAuthStateChanged.map(
        _userFromFirebaseUser);
  }

  // SignIn with Facebook
  Future signInFacebook() async {}

  // SignIn with Google
  Future signInGoogle() async {
    GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn();

    GoogleSignInAuthentication googleSignInAuthentication =
        await googleSignInAccount.authentication;

    AuthCredential credential = GoogleAuthProvider.getCredential(
        idToken: googleSignInAuthentication.idToken,
        accessToken: googleSignInAuthentication.accessToken);

    try {
      AuthResult result = (await _auth.signInWithCredential(credential));
      FirebaseUser user = result.user;
      return _userFromFirebaseUser(user);
    } catch (e) {
      print(e.toString());
      return null;
    }
  }

  // SignOut
  Future signOut() async {
    try {
      return await _auth.signOut();
    } catch (e) {
      print(e.toString());
      return null;
    }
  }
}

Set multiple application ID dynamically

Since we might need multiple ids for some applications. Like I want to authenticate users with one Facebook application, and want to connect users' Facebook/Instagram business pages in another Facebook application. So, in this case, I need to set the application ID dynamically.

#63 I tried to add this feature for now only for android.

Facebook photoURL not rendering properly after Firebase signInWithCredential (AuthCredential/UserCredential)

After logging in on Firebase using a Facebook AuthCredential obtained from a Facebook Token, the UserCredential's photoURL generates an incorrect URL that would not render a proper profile picture from Facebook.

Would this be a plugin bug? How can I confirm where in the process is the photoURL being set incorrectly?

        // Credential
        final AuthCredential credential =
            FacebookAuthProvider.credential(facebookToken.token);

        // Firebase Sign In
        final result = await authService.signInWithCredential(credential);

        print("UserCredential photoUrl \"${result.user.photoURL}\"");
        print(
            "getProfileUmageUrl: ${await facebookSignIn.getProfileImageUrl(width: 400)}");

Console output

flutter: UserCredential photoUrl "https://graph.facebook.com/**********/picture"
flutter: getProfileUmageUrl: https://graph.facebook.com/v9.0/**********/picture?access_token=EAAM1VXnjookBAO2*********rGtzx1x6Dmtb4Y96wVamw0B0kxU95dBZBOL3zqJGff9oMk15mI2hq2cgsSxNbk8rPaB77bA2K0UA9ApNhbPdE8V*******3vW53AdhPnZATJ8SI8w7NXceKSpZB9WzqZCliLA5q3ukVvKCIrWut8OQKQG3ZAo1W3vYZBugnwvg5Hf6ziIbtyWP0S&height=400&type=normal&width=400

The workaround is to capture the correct URL from getProfileImageUrl from the FacebookLogin instance and update the user profile with it.

    await _auth.currentUser
        .updateProfile(
            displayName: signInWithCredential.user.displayName,
            photoURL: await facebookSignIn.getProfileImageUrl(width: 400))
        .then((value) => null);

Unable to send data via rest api

I have a site where is login with fb is already implemented, now I am implementing in flutter app using this plugin. I can successfully login within app and token as well. But I am facing problem of sending this token to website over rest api. I am getting error. I am taken code from your example code. Below is my code-

  void _updateLoginInfo() async {
    final plugin = widget.plugin;
    final token = await plugin.accessToken;
    final profile = await plugin.getUserProfile();
    setState(() {
      _token = token;
      _profile = profile;
    });
    if(_token != null){
      String provider = 'facebook';
      verifySocialLogin(provider, _token);
    }
  }

  void verifySocialLogin(var provider, var token) async{
    String url = getSocialUrl(provider);
    // ----------------- Error location --------------
    var params = {"access_token": token, "token_type": "bearer","expires_in":9183946};
    final http.Response response = await http.post(url, body: params);
   // --------------------Error Ends -----------------
    if(response.statusCode == 200){
      print("all is good");
      print('here is the $response');
      
    }
    else{
      print('something is wrong');
    }
  }

Error- _CastError (type 'FacebookAccessToken' is not a subtype of type 'String' in type cast)
Error Image- https://paste.pics/a7bb115d520a82bbb782dc08ba27ff4f

When I changed code in Error location(specifying type), like following-

   // comment out params
   // var params = {"access_token": token, "token_type": "bearer","expires_in":9183946};

    final http.Response response = await http.post(url, body: jsonEncode(<String, FacebookAccessToken>{
      'access_token': token
    }));

still getting error.
Error- JsonUnsupportedObjectError (Converting object to an encodable object failed: Instance of 'FacebookAccessToken')
Error in Image - https://paste.pics/bc5737960575712996d75f02ebbc6379

How can I pass token and get response back in the right way? Thanks

Crashes when used with video_player plugin

I found out that video_player package crashes with the following error
only when I use this package.

File: video_player_platform_interface-2.2.0/lib/messages.dart

PlatformException (PlatformException(channel-error, Unable to establish connection on channel., null, null))

I wasn't sure where to report this. But this only happens when i use flutter_login_facebook.

regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.