Firebase 正在使用Facebook按钮创建登录。。。问题
我正在尝试为我的react native/expo/firebase应用程序创建一个“使用Facebook登录”按钮,但它不起作用 单击登录按钮时,我当前收到以下警告:可能未处理的承诺拒绝(id:4):错误:调用带有参数(我的Facebook应用id)的“ExponentFacebook.LoginWithReadPermissionsSync”时引发异常:-[\u NSCFString objectForKeyedSubscript:]:未识别的选择器已发送到实例 我做错了什么 以下是我的功能:Firebase 正在使用Facebook按钮创建登录。。。问题,firebase,react-native,expo,facebook-login,Firebase,React Native,Expo,Facebook Login,我正在尝试为我的react native/expo/firebase应用程序创建一个“使用Facebook登录”按钮,但它不起作用 单击登录按钮时,我当前收到以下警告:可能未处理的承诺拒绝(id:4):错误:调用带有参数(我的Facebook应用id)的“ExponentFacebook.LoginWithReadPermissionsSync”时引发异常:-[\u NSCFString objectForKeyedSubscript:]:未识别的选择器已发送到实例 我做错了什么 以下是我的功能
import firebase from './firebase.js';
import * as Facebook from 'expo-facebook';
export async function FacebookLogin() {
const appId = Expo.Constants.manifest.extra.facebook.appId;
const permissions = ['public_profile', 'email'];
Facebook.initializeAsync({appId: appId, appName: "Foo"});
const { type, token } = await
Facebook.logInWithReadPermissionsAsync(
appId,{
permission: permissions
}
);
if (type == "success") {
const credential =
firebase
.auth
.FacebookAuthProvider
.credential(token);
}
firebase
.auth().signInWithCredential(credential).catch(error => {
console.log(error);
});
}