import Expo from "expo"; import { Auth } from "aws-amplify"; ... class SignInScreen extends React.Component { ... loginWithFacebook = async () => { const { type, token, expires } = await Expo.Facebook.logInWithReadPermissionsAsync("1112222333444555", { permissions: ["public_profile", "email"] }); if (type === "success") { // Get the user's information with the Facebook Graph api. const response = await fetch( `https://graph.facebook.com/me?access_token=${token}&fields=id,name,email,first_name,last_name,picture` ); const user = await response.json(); return { user, token, expires_at: expires }; } return null; } amplifyFacebookSignIn = async () => { // Use Expo to login with facebook and get user info. const { user, token, expires_at } = await this.loginWithFacebook(); // Use the token to authenticated Amplify. await Auth.federatedSignIn("facebook", { token, expires_at }, user); // At any point you can get the user's information using Auth.currentUserInfo() const userDetails = await Auth.currentUserInfo(); console.log("Current user info:", userDetails); // Navigate away or do something... this.props.navigation.navigate({ routeName: "Main" }); } ... }