darwin-morocho / flutter-facebook-auth

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

Does not return all the data #151

Closed cavedweller closed 3 years ago

cavedweller commented 3 years ago

I am not sure if i just do not understand or if there is an error.

However, when logging into facebook I recieve all the neccessary data except one and that is the linked Instagram Business or Creator Account's data. My app is in live mode at the moment.

In the Facebook API documents it states:

Once your app is in Live Mode, any Facebook User who you've made your app available to can access an Instagram Business or Creator Account's data, as long as they have a Facebook User account that can perform Tasks on the Page connected to that Instagram Business or Creator Account.

Below I have screen shots he work flow: 1) The normal auth window InkedScreenshot_20210916-175057_Facebook_LI

2) If you click on edit you will see the following screen: InkedScreenshot_20210916-175153_Facebook_LI InkedScreenshot_20210916-175202_Facebook_LI InkedScreenshot_20210916-175210_Facebook_LI

Now my understanding is that once the user logs in, facebook will then return the linked business accounts. This can be done without calling extra api calls to the pages endpoint.

cavedweller commented 3 years ago

I dont think i was clear in my question, but how do i recieve the instagram id in the 2nd image without having to make additional api calls?

darwin-morocho commented 3 years ago

I dont think i was clear in my question, but how do i recieve the instagram id in the 2nd image without having to make additional api calls?

final userData = await FacebookAuth.instance.getUserData();

by default the getUserData method request name, email and picture profile if you need extra data

final result = await FacebookAuth.i.login(
    permissions: ['email', 'public_profile', 'instagram_basic','instagram_graph_user_profile'],
);

the getUserData method cannot be used to get the instagram data you will need to use the access token and make a request to instagram graph API

https://developers.facebook.com/docs/instagram-basic-display-api/reference/user

cavedweller commented 3 years ago

Thank you for your response quick response. Just thought that there might be a quicker way :)