darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
197 stars 141 forks source link

I can only get name and profile picture #332

Closed cancng closed 1 year ago

cancng commented 1 year ago

What version are you using?

flutter_facebook_auth:5.0.8

What OS and version are you using to local deploy your application?

macOS Ventura 13.2.1

What platforms are you seeing the problem on?

Android, iOS

pubspec.yaml

name: app
description: app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: 0.0.7+7

environment:
  sdk: ">=2.18.1 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2
  flutter_riverpod: ^1.0.4
  dio: ^4.0.6
  smooth_page_indicator: ^1.0.0+2
  get_it: ^7.2.0
  flutter_svg: ^1.1.5
  flutter_screenutil: ^5.5.4
  table_calendar: ^3.0.7
  intl: ^0.17.0
  carousel_slider: ^4.1.1
  hive: ^2.2.3
  hive_flutter: ^1.1.0
  form_validator: ^2.1.0
  url_launcher: 6.1.7
  flutter_html: 3.0.0-alpha.6
  easy_localization: ^3.0.1
  timeago: ^3.3.0
  flutter_slidable: ^2.0.0
  collection: ^1.16.0
  youtube_player_flutter: ^8.1.2
  image_picker: ^0.8.7
  image_cropper: ^3.0.1
  flutter_native_splash: ^2.2.18
  device_info_plus: ^8.1.0
  share_plus: ^6.3.1
  http: ^0.13.5
  path_provider: ^2.0.13
  flutter_facebook_auth: ^5.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  build_runner: ^2.3.2
  hive_generator: ^2.0.0
  flutter_launcher_icons: ^0.12.0

flutter:
  uses-material-design: true
  assets:
    - assets/illustrations/
    - assets/svg/
    - assets/images/
    - assets/translations/
  fonts:
    - family: Montserrat
      fonts:
        - asset: assets/fonts/Montserrat/Montserrat-Thin.ttf
          weight: 100
        - asset: assets/fonts/Montserrat/Montserrat-ThinItalic.ttf
          style: italic
          weight: 100
        - asset: assets/fonts/Montserrat/Montserrat-ExtraLight.ttf
          weight: 200
        - asset: assets/fonts/Montserrat/Montserrat-ExtraLightItalic.ttf
          style: italic
          weight: 200
        - asset: assets/fonts/Montserrat/Montserrat-Light.ttf
          weight: 300
        - asset: assets/fonts/Montserrat/Montserrat-LightItalic.ttf
          style: italic
          weight: 300
        - asset: assets/fonts/Montserrat/Montserrat-Regular.ttf
          weight: 400
        - asset: assets/fonts/Montserrat/Montserrat-Medium.ttf
          weight: 500
        - asset: assets/fonts/Montserrat/Montserrat-MediumItalic.ttf
          style: italic
          weight: 500
        - asset: assets/fonts/Montserrat/Montserrat-SemiBold.ttf
          weight: 600
        - asset: assets/fonts/Montserrat/Montserrat-SemiBoldItalic.ttf
          style: italic
          weight: 600
        - asset: assets/fonts/Montserrat/Montserrat-Bold.ttf
          weight: 700
        - asset: assets/fonts/Montserrat/Montserrat-BoldItalic.ttf
          style: italic
          weight: 700
        - asset: assets/fonts/Montserrat/Montserrat-ExtraBold.ttf
          weight: 800
        - asset: assets/fonts/Montserrat/Montserrat-ExtraBoldItalic.ttf
          style: italic
          weight: 800
        - asset: assets/fonts/Montserrat/Montserrat-Black.ttf
          weight: 900
        - asset: assets/fonts/Montserrat/Montserrat-BlackItalic.ttf
          style: italic
          weight: 900

Describe the Bug

I am trying to get user details with Facebook login. For example my login code like this

 onTap: () async {
                final result = await FacebookAuth.i.login(
                    permissions: ['public_profile', 'email', 'user_birthday', 'user_friends']);
                if (result.status == LoginStatus.success) {
                  // you are logged
                  final accessToken = result.accessToken!;
                  final userData = await FacebookAuth.i.getUserData(
                    fields: "name,email,picture.width(200),birthday,friends,gender,link",
                  );
                  inspect(userData);
                  print(accessToken.token);
                } else {
                  print(result.status);
                  print(result.message);
                }
},

Expected Behavior

I expect the details which I wanted. Email, public profile, birthday and friends for example.

To Reproduce

bomi-2023-03-28-14 09 57@2x

What I get

bomi-2023-03-28-14 10 29@2x

Relevant log output

No response

flutter doctor -v

[✓] Flutter (Channel stable, 3.3.9, on macOS 13.2.1 22D68 darwin-arm, locale en-TR)
    • Flutter version 3.3.9 on channel stable at /Volumes/canSSD/Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (4 months ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Volumes/canSSD/Library/androidsdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

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

[!] Android Studio (version 2022.1)
    • Android Studio at /Volumes/canSSD/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.3)
    • IntelliJ at /Users/mahmutcancng/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.3)
    • IntelliJ at /Volumes/canSSD/Applications/JBToolbox/apps/IDEA-U/ch-0/223.8836.41/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

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

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 111.0.5563.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

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)

No response

darwin-morocho commented 1 year ago

@cancng keep in mind that this is not an issue of this plugin, you need to check in your facebook console if you have allowed to get the fields that your are trying to get, also remember some fields requires additional permissions when you call to login