每当我使用纱线时,一切都会爆炸,这是反应原生社区给出的指示.
我已经尝试过做npm install --save然后使用link命令但到目前为止没有任何工作.
我究竟做错了什么?以及如何解决这个问题.
onsole.error: "RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully or try manual linking."
Run Code Online (Sandbox Code Playgroud)
经过 2 天的修补后,我放弃了 React googlesignin 的东西。我只是按照 firebase 指南和 expo 指南进行操作,一切正常。
Expo google 登录获取凭据,然后 firebase 检查凭据并让您登录。
如果你正在做一个 firebase googlelogin 的事情并且你已经有了 firebase 设置你可以做一些事情
googleLogin = async () => {
try {
const result = await Expo.Google.logInAsync({
androidClientId: "Your Client ID",
//iosClientId: YOUR_CLIENT_ID_HERE, <-- if you use iOS
scopes: ["profile", "email"]
})
if (result.type === "success") {
const credential = firebase.auth.GoogleAuthProvider.credential(result.idToken, result.accessToken);
firebase.auth().signInAndRetrieveDataWithCredential(credential).then(function(result){
console.log(result);
});
this.props.navigation.navigate('Where you want to go');
} else {
console.log("cancelled")
}
} catch (e) {
console.log("error", e)
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3125 次 |
| 最近记录: |