Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidScopeRequested error when login facebook #416

Open
tronghau2110 opened this issue Jun 28, 2024 · 7 comments
Open

InvalidScopeRequested error when login facebook #416

tronghau2110 opened this issue Jun 28, 2024 · 7 comments

Comments

@tronghau2110
Copy link

What version are you using?

flutter_facebook_auth: ^7.0.1

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

MacOS 14.1.1

What platforms are you seeing the problem on?

iOS

pubspec.yaml

environment:
  sdk: '>=2.19.6 <4.0.0'
dependencies:
    flutter_facebook_auth: ^7.0.1
  flutter_test:
    sdk: flutter
  integration_test:
    sdk: flutter
 
dependency_overrides:
  http: ^0.13.0
  analyzer: ^5.2.0
  archive: ^3.3.2
  bloc_test: ^9.1.1
  photo_view: ^0.14.0
  provider: ^6.0.0
  intl: 0.17.0
  dart_style: 2.3.2

Describe the Bug

Screenshot 2024-06-28 at 17 19 52

  • When I login facebook with permissions, it created bug as image. How do fix it? lib: facebook_auth_flutter 7.0.1
    loginPermission=[
    "email",
    ,"user_videos"
    , "manage_pages"
    ,"user_posts"
    ,"public_profile"
    ,"pages_manage_engagement"
    , "pages_read_engagement"
    , "pages_manage_metadata"
    ,"pages_show_list"
    ,"pages_manage_posts"
    , "manage_pages"
    ,"pages_messaging"
    , "publish_pages"
    , "pages_messaging"

    final loginPermission =
    permission ?? _remoteConfigService.facebookOption.permissions;

    final LoginResult loginResult = await _auth.login(
    loginBehavior: isWebBehavior
    ? LoginBehavior.webOnly
    : LoginBehavior.nativeWithFallback,
    permissions: loginPermission
    ..removeWhere(
    (f) => f == 'manage_pages' || f == 'publish_pages',
    ),
    );

Expected Behavior

I can login facebook

To Reproduce

Screenshot 2024-06-28 at 17 19 52

  • When I login facebook with permissions, it created bug as image. How do fix it? lib: facebook_auth_flutter 7.0.1
    loginPermission=[
    "email",
    ,"user_videos"
    , "manage_pages"
    ,"user_posts"
    ,"public_profile"
    ,"pages_manage_engagement"
    , "pages_read_engagement"
    , "pages_manage_metadata"
    ,"pages_show_list"
    ,"pages_manage_posts"
    , "manage_pages"
    ,"pages_messaging"
    , "publish_pages"
    , "pages_messaging"

    final loginPermission =
    permission ?? _remoteConfigService.facebookOption.permissions;

    final LoginResult loginResult = await _auth.login(
    loginBehavior: isWebBehavior
    ? LoginBehavior.webOnly
    : LoginBehavior.nativeWithFallback,
    permissions: loginPermission
    ..removeWhere(
    (f) => f == 'manage_pages' || f == 'publish_pages',
    ),
    );

Relevant log output

No response

flutter doctor -v

[✓] Flutter (Channel stable, 3.10.6, on macOS 14.1.1 23B81 darwin-x64, locale en-VN)
    • Flutter version 3.10.6 on channel stable at /Users/hauddt/Downloads/flutter 2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (12 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/hauddt/Library/Android/sdk
    • Platform android-34, build-tools 33.0.2
    • ANDROID_HOME = /Users/hauddt/Library/Android/sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.1+12-39)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.14.3

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

[!] Android Studio (version 2023.1)
    • Android Studio at /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.

[✓] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554                        • android-x64    • Android 13 (API 33) (emulator)
    • iPhone 15 Pro (mobile)       • F9392F40-3B2A-497C-8A93-D70A3C7CB1F9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • macOS (desktop)              • macos                                • darwin-x64     • macOS 14.1.1 23B81 darwin-x64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 123.0.6312.86

[✓] Network resources
    • All expected network resources 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

@Tameflame
Copy link

I'm getting the same issue on ios, when on the webview it fails, but when using android and going to the native fb app for login, it works.

@Azhun20
Copy link

Azhun20 commented Oct 18, 2024

The solution?

@darwinmorocho-deuna
Copy link
Contributor

@Azhun20 @Tameflame @tronghau2110 go to the permissions list page and check that you are not passing invalid or obsolete permissions

https://developers.facebook.com/docs/permissions

@MuhammadFaizan980
Copy link

@Azhun20 @Tameflame @tronghau2110 go to the permissions list page and check that you are not passing invalid or obsolete permissions

https://developers.facebook.com/docs/permissions

If it was permission issue then I think it should also give error on android but its not the case, my android app is working fine, I am able to login but on iOS it is giving this error

@JosePabloGoni
Copy link

Any update on this? Thanks

@DevineStar24
Copy link

The same error occurred while check on iOS with facebook graph APIs for Instagram and facebook content publish and manage pages

@onursahindur
Copy link

onursahindur commented Feb 1, 2025

You need to use LoginTracking.enabled when sending the login request.

First, ask for the user's tracking permission. If the user grants access, send the login request as shown below:

final LoginResult result = await FacebookAuth.i.login(
      loginBehavior: LoginBehavior.webOnly,
      loginTracking: LoginTracking.enabled, // < - - - - - - - - - - - - - Use it here
      permissions: [
        'email', 
        'public_profile',
        'business_management',
        'instagram_basic',
        'pages_show_list',
        'pages_read_engagement',
        'instagram_manage_insights',
      ]
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants