signInWithPopup不适用于android(Ionic 2 + Firebase 3)

时间:2016-11-26 05:17:15

标签: authentication firebase ionic-framework

我想在我的Ionic 2 + Firebase 3应用程序中使用signInWithPopup!它在桌面浏览器上运行良好但是,当我为Android生成APK时,它会在弹出窗口出现之前在auth.js中引发网络错误。然后,我输入凭据,然后显示该应用程序的空白屏幕。提前致谢

 var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
  // This gives you Access Token. You can use it to access the Google API.
  this.navCtrl.push(WriteReviewPage);
  // ...
}).catch(function(error) {
  alert(error.message);
});

}

1 个答案:

答案 0 :(得分:0)

signInWithPopup()不适用于Ionic / Cordova应用

有一个解决方法,你需要安装Google Sign-in plugin

可行的方法是使用插件记录用户,然后将这些凭据传递给Firebase。

我为Facebook authentication制作了一些内容,您将遵循相同的流程,而不是使用Google插件。