0
I have a mobile app made in React On, I am logging in via facebook using lib React-Native-fbsdk but it works but I am having problems in redeeming user data, I had to see some topics here on the forum of the same situation and followed as some of them but still does not work. I’m gonna knock down the code I’m using.
Login function
loginFacebook = () => {
LoginManager.logInWithPermissions(["public_profile", "email"]).then(
function(result) {
if (result.isCancelled) {
console.log("Login cancelled");
} else {
AccessToken.getCurrentAccessToken().then(data => {
const processRequest = new GraphRequest(
"/me?fields=name,email,picture.type(large)",
null,
this.get_Response_Info
);
new GraphRequestManager().addRequest(processRequest).start();
});
}
},
function(error) {
console.log("Login fail with error: " + error);
}
);
};
Function that should take the data
get_Response_Info = (error, result) => {
if (error) {
Alert.alert("Error fetching data: " + error.toString());
} else {
console.log(result.toString());
}
};
In this function the console.log(result)
does not execute I think because in the console not well anything.
Thanks for the help, thanks to that I’ll get it the right way and get it to work as I wanted and that’s exactly what you indicated, thank you
– César Sousa
Just to supplement the question for those who come to help, I have now followed and implemented according to your orders and yes this perfect to work as wanted, thanks again
– César Sousa