After release app, on some devices method LoginManager.logInWithPermissions returns isCancelled: true despite user was logged in and Facebook shows that user is logged to my app. But I'm not able to take token, because of first step... And when I'm doing AccessToken.getCurrentAccessToken() I'm receiving null.
To Reproduce
Actually it's hard to reproduce, it's not occurring on all devices. One of them is Samsung Galaxy J7 and Android 9 - but in emulator it is working fine. On Physical device it's not working - only on released app, when I connect device to computer and run debug version of app on the phone then it's working fine.
Expected Behavior
I would like to have answer what should I configure or add to code to avoid this issue and be able to log in on every devices.
Code Example
my function which is called on click:
const loginWithFacebook = async () => {
// Attempt a login using the Facebook login dialog asking for default permissions.
try {
const loginData = await LoginManager.logInWithPermissions([
'public_profile',
]);
if (loginData.isCancelled) {
alert('Login interrupted');
} else {
const accessData = await AccessToken.getCurrentAccessToken();
setToken(accessData.accessToken.toString());
navigation.navigate('Home')
}
} catch {
alert('Something went wrong, Try again');
}
}
🐛 Bug Report
After release app, on some devices method
LoginManager.logInWithPermissions
returnsisCancelled: true
despite user was logged in and Facebook shows that user is logged to my app. But I'm not able to take token, because of first step... And when I'm doingAccessToken.getCurrentAccessToken()
I'm receivingnull
.To Reproduce
Actually it's hard to reproduce, it's not occurring on all devices. One of them is Samsung Galaxy J7 and Android 9 - but in emulator it is working fine. On Physical device it's not working - only on released app, when I connect device to computer and run debug version of app on the phone then it's working fine.
Expected Behavior
I would like to have answer what should I configure or add to code to avoid this issue and be able to log in on every devices.
Code Example
Environment
npmPackages: react-native-fbsdk => 1.1.2 react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1