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

Login Error with Facebook business login with additional permissions #409

Open
DevineStar24 opened this issue Jun 4, 2024 · 19 comments
Open

Comments

@DevineStar24
Copy link

What version are you using?

7.0.0

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

iOS 17.5 and minimum is iOS 14

What platforms are you seeing the problem on?

Android, iOS

pubspec.yaml

name: App name

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




version: 1.0.0+1

environment:
  sdk: '>=2.18.6 <3.0.0'

dependencies:
  flutter:
    sdk: flutter

  shared_preferences: ^2.2.3
  intl: ^0.19.0
  chewie: ^1.8.1
  video_player: ^2.8.6
  file_picker: ^8.0.3
  flutter_facebook_auth: ^7.0.0
 





dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.0

flutter:
  assets:
    - assets/images/

Describe the Bug

I simply login and get business pages list which is connect with my Facebook account
and here is my code
` Future faceBookSignIn() async {
try {
loader.value = true;
final LoginResult loginResult = await FacebookAuth.instance.login(
permissions: [
"public_profile",
"email",
"openid",
"pages_show_list",
"business_management",
"instagram_basic",
"pages_manage_engagement",
"pages_read_engagement",
"pages_manage_posts",
"instagram_content_publish",
"instagram_manage_insights"
],
// loginBehavior: LoginBehavior.webOnly
);

  if (loginResult.status == LoginStatus.success) {
    final userData = await FacebookAuth.instance.getUserData();

    log("------------: FB LOGIN STATUS: ${loginResult.status}"); // -> **I am getting SUCCESS here and then invalidsscope error**
    log("------------: access token: ${loginResult.accessToken!.tokenString}");

  }
} catch (e) {
  print(e.toString());
}

}`

in same code it is working fine in flutter_facebook_auth: 5.0.8
Also getting token with my wished permissions

And in lettest version, i am getting facebook login success, but not getting token and getting error

Error that displays in facebook login popup is
**invalid scope requested: the combination of scope requested are not valid**

unnamed

Expected Behavior

I expect that it should be login in new package version also

To Reproduce

Use permission which i used, and choose app type to other when create app
Add facebook login sdk from Meta developer console
ant try facebook login with latest package

Relevant log output

No response

flutter doctor -v

>flutter doctor -v
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4412], locale en-IN)
    • Flutter version 3.22.0 on channel stable at D:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (10 weeks ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.4.0
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\MYNAME\AppData\Local\Android\sdk
    • Platform android-34, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio 2024\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio 2024
    • 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
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.89.1)
    • VS Code at C:\Users\MYNAME\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • SM F127G (mobile) • RZ8RA0L1YZJ • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.19045.4412]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 125.0.6422.114
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 125.0.2535.51

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Info.plist (iOS)

No need because in older version it's working fine without change any configuration

Podfile (iOS)

No need because in older version it's working fine without change any configuration

AndroidManifest.xml

No response

MainActivity.java

No response

MainActivity.kt

No response

index.html

No response

Info.plist (macOS)

No response

@PSBARTERGRAM
Copy link

i am facing the exact same issue pls provide us solution

@DevineStar24
Copy link
Author

Sorry
I am also finding a solution

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 6, 2024 via email

@AndRud
Copy link

AndRud commented Jun 9, 2024

Sorry I am also finding a solution

Hi. Do you receive the next message on the FB login page?
"If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS. The access token will not be valid. To learn more about changes to the Facebook SDK for iOS and how you can continue using the Facebook Login SDK, visit the blog."

@DevineStar24
Copy link
Author

DevineStar24 commented Jun 9, 2024 via email

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 9, 2024 via email

@AndRud
Copy link

AndRud commented Jun 9, 2024

How to switch from limited login to full access login ? Have you fixed this the problem?

On Sun, 9 Jun 2024 at 1:35 PM, AndRud @.> wrote: Sorry I am also finding a solution Hi. Do you receive the next message on the FB login page? "If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS. The access token will not be valid. To learn more about changes to the Facebook SDK for iOS and how you can continue using the Facebook Login SDK, visit the blog." — Reply to this email directly, view it on GitHub <#409 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI56IPLBNXYPUURD3HIDIHLZGQEE5AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM3TQMRUGE . You are receiving this because you authored the thread.Message ID: @.>

I made an ATT request before FB login and then made it enabled in FacebookAuth.login(loginTracking: LoginTracking.enabled, nonce: nonce, permissions: [...]) and it worked. However, I still get a warning "If you are not using Limited Login,..." and do not understand what else should be done to get rid of it.

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 9, 2024 via email

@AndRud
Copy link

AndRud commented Jun 9, 2024

We have to give permission that we are tracking them and it will shift from limited.facebook.login login to Facebook.login

On Sun, Jun 9, 2024, 1:51 PM AndRud @.> wrote: How to switch from limited login to full access login ? Have you fixed this the problem? … <#m_-8071317692350319408_> On Sun, 9 Jun 2024 at 1:35 PM, AndRud @.> wrote: Sorry I am also finding a solution Hi. Do you receive the next message on the FB login page? "If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS. The access token will not be valid. To learn more about changes to the Facebook SDK for iOS and how you can continue using the Facebook Login SDK, visit the blog." — Reply to this email directly, view it on GitHub <#409 (comment) <#409 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI56IPLBNXYPUURD3HIDIHLZGQEE5AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM3TQMRUGE https://github.com/notifications/unsubscribe-auth/BI56IPLBNXYPUURD3HIDIHLZGQEE5AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM3TQMRUGE . You are receiving this because you authored the thread.Message ID: @.> I made an ATT request before FB login and then made it enabled in FacebookAuth.login(loginTracking: LoginTracking.enabled, nonce: nonce, permissions: [...]) and it worked. However, I still get a warning "If you are not using Limited Login,..." and do not understand what else should be done to get rid of it. — Reply to this email directly, view it on GitHub <#409 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIBMELMLZVV4MUHO7CHX4QDZGQF63AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM4DMNZQGM . You are receiving this because you commented.Message ID: @.**>

Do you mean to put this permission in the login function?

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 9, 2024 via email

@AndRud
Copy link

AndRud commented Jun 9, 2024

If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS

I was talking about this warning (https://stackoverflow.com/questions/78472055/facebook-ios-sdk-v17-0-error-if-you-are-not-using-limited-login-you-will-need). But I've just made current FB user as non-tester (regular) and the warning disappeared.

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 9, 2024 via email

@DevineStar24
Copy link
Author

We have to give permission that we are tracking them and it will shift from limited.facebook.login login to Facebook.login

On Sun, Jun 9, 2024, 1:51 PM AndRud @.> wrote: How to switch from limited login to full access login ? Have you fixed this the problem? … <#m_-8071317692350319408_> On Sun, 9 Jun 2024 at 1:35 PM, AndRud @.> wrote: Sorry I am also finding a solution Hi. Do you receive the next message on the FB login page? "If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS. The access token will not be valid. To learn more about changes to the Facebook SDK for iOS and how you can continue using the Facebook Login SDK, visit the blog." — Reply to this email directly, view it on GitHub <#409 (comment) <#409 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI56IPLBNXYPUURD3HIDIHLZGQEE5AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM3TQMRUGE https://github.com/notifications/unsubscribe-auth/BI56IPLBNXYPUURD3HIDIHLZGQEE5AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM3TQMRUGE . You are receiving this because you authored the thread.Message ID: @.> I made an ATT request before FB login and then made it enabled in FacebookAuth.login(loginTracking: LoginTracking.enabled, nonce: nonce, permissions: [...]) and it worked. However, I still get a warning "If you are not using Limited Login,..." and do not understand what else should be done to get rid of it. — Reply to this email directly, view it on GitHub <#409 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIBMELMLZVV4MUHO7CHX4QDZGQF63AVCNFSM6AAAAABIYSE63KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWGM4DMNZQGM . You are receiving this because you commented.Message ID: @.**>

How do you do that ?

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 11, 2024 via email

@PSBARTERGRAM
Copy link

PSBARTERGRAM commented Jun 11, 2024 via email

@DevineStar24
Copy link
Author

DevineStar24 commented Jun 11, 2024 via email

@DevineStar24
Copy link
Author

in latest version flutter_facebook_auth: ^7.0.1 also i am getting same error
Screenshot 2024-06-20 at 10 14 23 AM

my code is
` Future faceBookSignIn() async {
String generateNonce([int length = 32]) {
const charset =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-.';
final random = math.Random.secure();
return List.generate(length, (
) => charset[random.nextInt(charset.length)])
.join();
}

try {
final nonce = generateNonce();

  final LoginResult loginResult = await FacebookAuth.instance.login(
    permissions: [
      "public_profile",
      "email",
      "openid",
      "pages_show_list",
      "business_management",
      "instagram_basic",
      "pages_manage_engagement",
      "pages_read_engagement",
      "pages_manage_posts",
      "instagram_content_publish",
      "instagram_manage_insights"
    ],
      loginTracking: LoginTracking.enabled,
      nonce: nonce
  );

  if (loginResult.status == LoginStatus.success) {
    final userData = await FacebookAuth.instance.getUserData();
    log("================:UD  $userData");
  } 
} catch (e) {
  print(e.toString());
}

}`

anyone fixed this ?

@datpt11
Copy link

datpt11 commented Jun 24, 2024

same issue

@Tameflame
Copy link

I've got this issue and I am also requesting for app tracking permissions with https://pub.dev/packages/app_tracking_transparency

Login works completely fine on android it's just the webview goes to limited.facebook.com on ios. Can anyone advise?

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

5 participants