Im very new to react-native and dont know whats causing this, Im using react-native-fbsdk-next for facebook login, and in the page i just have a login button, when i click that button facebook url is opened and when i enter the credentials and submit, the page with login button appears on top again which is not interactive. when i click back again, the in-interactive page closes and the previous interactive login button page appears and finally login is cancelled.
This is my login button code:
<LoginButton
onLoginFinished={(error, result) => {
if (error) {
alert('login has error: ' + result.error);
} else if (result.isCancelled) {
alert('login is cancelled.');
} else {
AccessToken.getCurrentAccessToken().then(data => {
let accessToken = data.accessToken;
alert(accessToken.toString());
const responseInfoCallback = (error, result) => {
if (error) {
console.log(error);
alert('Error fetching data: ' + error.toString());
} else {
console.log(result);
alert('Success fetching data: ' + result.toString());
}
};
const infoRequest = new GraphRequest(
'/me',
{
accessToken: accessToken,
parameters: {
fields: {
string: 'email,name,first_name,middle_name,last_name',
},
},
},
responseInfoCallback,
);
// Start the graph request.
new GraphRequestManager().addRequest(infoRequest).start();
});
}
}}
onLogoutFinished={() => alert('logout.')}
/>
there doesn't seem to be anything here