React-native-fbsdk: Can't get user Email

Created on 22 Apr 2020  路  1Comment  路  Source: facebook/react-native-fbsdk

Hi
I 'm using your wallpaper on my application on Android and my code is blow .
I can't get the email of user thought GraphRequest.

`const getFacebookUserInfo = () => {
const responseInfoCallback = (error, result) => {
if (error) {
console.log('Error fetching data: ' + error.toString());
} else {
Log('Success fetching data: ', result);
}
};

const param = {
  fields: {
    string: 'email',
  },
};
// Create a graph request asking for user information with a callback to handle the response.
const infoRequest = new GraphRequest(
  '/me',
  {
    httpMethod: 'GET',
    version: 'v2.5',
    parameters: param,
  },
  responseInfoCallback,
);
// Start the graph request.
const res = new GraphRequestManager().addRequest(infoRequest).start();
Log('Res is :', res);

};`

In my response is :

Success fetching data: {id: "..."}

I can't see email parameter in response

Most helpful comment

Seems like the have updated the Loginbutton component

you should change
readPermissions={["email"]}

to
permissions={["email"]}

Everything should be working right after

>All comments

Seems like the have updated the Loginbutton component

you should change
readPermissions={["email"]}

to
permissions={["email"]}

Everything should be working right after

Was this page helpful?
0 / 5 - 0 ratings