Hi guys,
I had a strange issue with the facebook login, executing the Facebook.logInWithReadPermissionsAsync
the application correctly open a popup asking "Expo" Wants to Use "facebook.com" to SignIn
;
clicking on continue it always open a browser view with this message from Facebook:
Sorry, something went wrong.
We are working on it and we'll get it fixed as soon as we can.
this is the code (basically is the same of the documentation page)
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import * as Facebook from 'expo-facebook';
export default function App() {
return (
<View style={styles.container}>
<TouchableOpacity
onPress={async () => {
try {
await Facebook.initializeAsync('<facebookAppId>');
const {
expires,
type,
token,
} = await Facebook.logInWithReadPermissionsAsync({
permissions: ['public_profile', 'email', 'first_name', 'last_name']
});
if (type === 'success') {
fetch(`https://graph.facebook.com/me?access_token=${token}`)
.then((response) => response.json())
.then(user => {
console.log('login: get user data ok');
});
}
return false;
} catch ({ message }) {
alert(`Facebook Login Error: ${message}`);
return false;
}
}}
>
<Text>Facebook Login</Text>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Also, I tried both SDK version 35 and 36 (with the obvious changes in the code) using the respective client version, but I obtain the same error.
I checked the configuration on facebook and seems correct.
Any idea on how to fix?
thanks
SDK Version: 35 and 36
Platforms(Android/iOS/web/all): ios (simulator and physical device), android (emulator and physical device)