angular – Firebase Ionic3错误:disallowed_useragent

前端之家收集整理的这篇文章主要介绍了angular – Firebase Ionic3错误:disallowed_useragent前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
this topic上有几个其他问题/答案,但他们没有使用带有Ionic的Firebase.我刚刚切换到新的Ionic View,现在,我的应用程序在旧的Ionic View中工作,而新的Ionic View给出了这个众所周知的错误

403 Error – Thats an error. Error: disallowed_useragent his user-agent
is not permitted to make an OAuth authorization request to Google as
it is classified as an embedded user-agent (also known as a web-view).
blah blah blah

在我的代码中,我注入Firebase AuthProvider并使用angularfire2进行连接,它看起来像

private getProvider(from: string): AuthProvider {
  switch (from) {
    case 'twitter': return new firebase.auth.TwitterAuthProvider();
    case 'facebook': return new firebase.auth.FacebookAuthProvider();
    case 'github': return new firebase.auth.GithubAuthProvider();
    case 'google': return new firebase.auth.GoogleAuthProvider();
  }
}

  signIn(from: string) {
    this.afAuth.auth.signInWithPopup(this.getProvider(from))
. . .

再次,这在浏览器或旧的Ionic中很有用,但不适用于新的Ionic View.我确实有一个相当大的库与一般OAuth连接,但我认为使用Firebase的一个重要原因是我们不再需要使用这些库并自己管理用户.

有没有办法通过Ionic在iOS / Android应用上进行Firebase身份验证?

解决方法

试试这个

离子cordova构建android –minifycss –optimizejs –minifyjs

为我解决

猜你在找的Angularjs相关文章