An error occurred while trying to log in to Facebook
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper
- node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.native.js:15:35 in moduleName.methodInfo.name
- … 9 more stack frames from framework internals
I also tried deleting node modules and installing it again but again and again I keep getting the same error.
initializeAsync works fine but
const data = await Facebook.logInWithReadPermissionsAsync({
permissions: [‘email’],
});
This always throws an error mentioned above on Android.
iOS it is working fine
await Facebook.initializeAsync({
appId: <secret>,
appName: 'AwesomeProject',
autoLogAppEvents: true
})
const {
type,
token
} = await Facebook.logInWithReadPermissionsAsync({
permissions: ['public_profile'],
});
if (type === 'success') {
// Get the user's name using Facebook's Graph API
const response = await fetch(`https://graph.facebook.com/me?access_token=${token}`);
console.log(await response.json())
} else {
// type === 'cancel'
}
I also tried the solution an-error-occurred-while-trying-to-log-in-to-facebook/50785
But it did not work
Full error