darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
193 stars 127 forks source link

user_photos #110

Closed aliakkawi closed 2 years ago

aliakkawi commented 2 years ago

Hello and thanks for the useful repo, I need help with getting user's photos from Facebook. In the login method i included 'user_photos' to the permissions list like the following:

final LoginResult facebookLoginResult = await _facebookLogin.login(permissions: [ 'email', 'public_profile', 'user_photos' ]);

By using the 'userId' and 'token' form the AccessToken, i am performing a get request to the Facebook Graph Api GET /v11.0/{page-id}/photos Host: graph.facebook.com and i am getting an empty data Status 200 OK: { "data": [] }

After the login i checked the granted permissions for the user on both Android and iOS and they were as the following, [openid, public_profile, email]

I

In the past i have been able to get the user's photos using the api, but suddenly it stopped working properly Please advice me what changes i have to do in order to fix that. Thanks in advance Screen Shot 2021-06-16 at 12 26 44

darwin-morocho commented 2 years ago

Hi. Please use the AccessToken instance and check the grantedPermissions to see if you have the user_photos permissions. The user_photos permissions needs to be approved by Facebook.

Also you can use the getUserData method to get the user images

FacebookAuth.instance.getUserData(fields:"photos")

aliakkawi commented 2 years ago

Hello and thanks for your response, granted permissions are as follow: [openid, public_profile, email] My app is still in development and it is not live yet, i am using pre defined test users.

darwin-morocho commented 2 years ago

Hello and thanks for your response, granted permissions are as follow: [openid, public_profile, email] My app is still in development and it is not live yet, i am using pre defined test users.

In that case go to the Facebook user settings in the Facebook page and delete your app from the list and test the login again

aliakkawi commented 2 years ago

I've done so but still no photos permission is requested. login_fb

darwin-morocho commented 2 years ago

I've done so but still no photos permission is requested. login_fb

Are you testing this with an account that has a role in the app (admin, developer or tester)? Otherwise you of course need to submit the permission for review

aliakkawi commented 2 years ago

sure, i am using a tester account.

darwin-morocho commented 2 years ago

sure, i am using a tester account.

If you try with other permission like user_birthday this is requested?

aliakkawi commented 2 years ago

yes birthday is requested Screenshot_20210616-132925_Facebook

darwin-morocho commented 2 years ago

yes birthday is requested Screenshot_20210616-132925_Facebook

Great that means the plugin is working fine. Maybe the problem is in your facebook developer console. Please go to your console and check if you have some alerts.

darwin-morocho commented 2 years ago

I've tested the user_photos permission and it works fine

 final result = await _facebookAuth.login(permissions: [
      'email',
      'public_profile',
      'user_photos',
    ]);

Screenshot_1623854127

aliakkawi commented 2 years ago

I am getting this message "Your app has Standard Access to public_profile. To use Facebook Login, switch public_profile to Advanced Access. Get Advanced Access". I've tried to submit a review request before, but in order to be approved i have to send them a walk through video for a working case, so unless i solve the issue i cannot send the request. By the way i am using flutter_facebook_auth: ^3.3.3-no-nullsafety

aliakkawi commented 2 years ago

Screen Shot 2021-06-16 at 18 56 23

darwin-morocho commented 2 years ago

Yes the problems is your configuration on the facebook developers console. I cannot help you with that because that depends of facebook. Please contact with facebook support to solve your issue. https://developers.facebook.com/support/

I'm closing this because is not an issue of this plugin.

aliakkawi commented 2 years ago

Thanks a lot for your help, i really appreciate.