我没有收到用户的电子邮件,而是收到“未定义”。我不太清楚为什么,这是代码:
async handleFacebookLogin() {
const { type, token } = await Expo.Facebook.logInWithReadPermissionsAsync('1993067717635287', {
permissions: ['public_profile', 'email'],
});
if (type === 'success') {
const response = await fetch(
`https://graph.facebook.com/me?access_token=${token}`);
Alert.alert(
'Logged in!',
`Hi ${(await response.json()).email}!`
);
}
else
Alert.alert ('Connection error');
}