'How do I create a Facebook Login with Expo React Native and Firebase
I'm quite new to React Native and Expo and would much appreciate it if I could get some help on how to create a Facebook Login. For now I have done this, but I don't know how to hook the token I get from Facebook to my app so that I have the credentials and allow login.
try {
await Facebook.initializeAsync({
appId: 'myId',
});
const { type, token, expirationDate, permissions, declinedPermissions } =
await Facebook.logInWithReadPermissionsAsync({
permissions: ['public_profile'],
});
if (type === 'success') {
const response = await fetch(`https://graph.facebook.com/me?access_token=${token}`);
} else {
type === 'cancel'
}
} catch ({ message }) {
alert(`Facebook Login Error: ${message}`).finally();
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
