我想使用google auth尝试使用firebase进行同一项目。
在我的反应项目中,我有一个带有此onPress功能的按钮=>
import firebase from 'firebase';
const provider = new firebase.auth.GoogleAuthProvider();
handleLogIn() {
firebase.auth().signInWithPopup(provider)
.then((result) => {
// ...
})
.catch(function(error) {
// ...
});
}
但这会返回一个空白页......任何建议?
更新:使用signInWithRedirect()可以正常工作
答案 0 :(得分:0)
如果用户已登录并已为应用程序提供所需权限,则会打开和关闭空白页。在这种情况下,应用程序只返回数据。
答案 1 :(得分:0)
handleLogIn(e) {
e.preventDefault() ;
firebase.auth().signInWithPopup(provider)
.then((result) => {
// ...
})enter code here
.catch(function(error) {
// ...
});
}