当我使用Firebase将facebook auth与react-native连接时会生成错误
fbAuth() {
LoginManager.logInWithReadPermissions([
"public_profile",
"user_friends",
"email"
]).then(
result => {
if (result.isCancelled) {
Alert.alert("Whoops!", "You cancelled the sign in.");
} else {
AccessToken.getCurrentAccessToken().then(data => {
const credential = firebase.auth.FacebookAuthProvider.credential(
data.accessToken
);
firebase
.auth()
.signInWithCredential(credential)
.then(loginUserSuccess(dispatch))
.catch(error => {
loginSingUpFail(dispatch, error.message);
});
});
}
},
error => {
Alert.alert("Sign in error", error);
}
);}
有没有模块的问题,发现这是我的代码,我在其中集成了fb身份验证代码
答案 0 :(得分:0)
导入文件的方式是错误的。检查您要导入的路径并进行更正。会起作用