Facebook Login Error: Error with Facebook login

Hello i implement login with expo facebook but I got a message Facebook Login error: Error with Facebook login.

Here are my files:

App.js

import React from ‘react’;
import { StyleSheet, Text, View, Button } from ‘react-native’;
import * as Facebook from ‘expo-facebook’;

export default class App extends React.Component {
async _onPressButton() {
alert(‘You ff tapped the button!’)
}

async logIn() {
try {
const {
type,
token,
expires,
permissions,
declinedPermissions,
} = await Facebook.logInWithReadPermissionsAsync(’<my_app_id>’, {
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});
Alert.alert(‘Logged in!’, Hi ${(await response.json()).name}!);
} else {
// type === ‘cancel’
}
} catch ({ message }) {
alert(Facebook Login Error: ${message});
}
}
render(){
return (

Open up App.js to start working on your app!


);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: ‘#fff’,
alignItems: ‘center’,
justifyContent: ‘center’,
},
});

app.json

{
“expo”: {
“name”: “LogInTest”,
“slug”: “LogInTest”,
“privacy”: “public”,
“sdkVersion”: “35.0.0”,
“platforms”: [
“ios”,
“android”,
“web”
],
“version”: “1.0.0”,
“orientation”: “portrait”,
“icon”: “./assets/icon.png”,
“facebookScheme”:“my_facebookScheme”,
“facebookAppId”: “my_facebookAppId”,
“facebookDisplayName”: “TestLogIn”,
“splash”: {
“image”: “./assets/splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#ffffff
},
“updates”: {
“fallbackToCacheTimeout”: 0
},
“assetBundlePatterns”: [
“**/*”
],
“ios”: {
“supportsTablet”: true
}
}
}

any ideas?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.