【问题标题】:Ionic 2 firebase + anguarfire2 android device not showing up the facebook auth popupIonic 2 firebase + anguarfire2 android 设备未显示 facebook auth 弹出窗口
【发布时间】:2017-09-23 12:21:39
【问题描述】:

我正在使用 ionic 2 构建一个应用程序,并且我在其中有一个登录系统。我正在使用 firebase 和 angularfire2 连接到 firebase 并使用 firebase 提供的身份验证系统。以下是我用于 facebook auth 的代码。

  loginwithfacebook() {
    this.angfire.auth.login({
    provider: AuthProviders.Facebook,
    method: AuthMethods.Popup
    }).then((response) => {
      console.log('Login Success with facebook' + JSON.stringify(response));
      let currentuser = {
        email: response.auth.displayName,
        picture: response.auth.photoURL
      };
      window.localStorage.setItem('currentuser', JSON.stringify(currentuser));
      this.navCtrl.push(Dashboard);
    }).catch((error) => {
      console.log(error);
    })
  }

当我运行ionic serve 时,这在浏览器中运行良好,但是当我在我的 android 5.0 中使用ionic run android --device 对其进行测试时,当我单击“使用 facebook 登录”按钮时,弹出窗口不会出现。我尝试使用cordova add plugin inappbrowser,但弹出窗口出现并关闭并且不起作用。我也试过crosswalk,当我点击按钮时应用程序关闭。我该如何解决这个问题?

【问题讨论】:

标签: cordova ionic-framework ionic2 firebase-authentication angularfire2


【解决方案1】:

您需要安装 cordova-plugin-facebook4 才能在您的移动设备中使用它。

请参考说明here

【讨论】:

    猜你喜欢
    • 2021-08-16
    • 1970-01-01
    • 1970-01-01
    • 2020-04-18
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 2018-12-12
    • 1970-01-01
    相关资源
    最近更新 更多