【问题标题】:ionic + firebase / authWithOAuthPopup离子 + firebase / authWithOAuthPopup
【发布时间】:2016-07-04 08:41:49
【问题描述】:

我正在尝试第一个适用于 android 和 ios 的应用程序。我想用 twitter 登录。它的工作原理是 chrome 切换设备模式。但是,所以我安装在我的 android 手机上我无法登录。什么是问题?对不起我的英语不好..

  $scope.LoginTwitter = function(){

    ref.authWithOAuthPopup("twitter", function(error, authData) {

      if (error) {
        console.log("Login Failed!", error);
        alert(error);
      } else {
      // console.log("Authenticated successfully with payload:", authData);
        UserControlfunc(authData);
        $state.go("home");

        }
    });
  }

【问题讨论】:

    标签: android angularjs ionic-framework firebase


    【解决方案1】:

    Firebase 不支持 Android 和 iOS 上的弹出窗口。您应该尝试改用 $authWithOAuthRedirect。这里的例子: https://www.firebase.com/docs/web/libraries/ionic/guide.html#section-user-authentication

    【讨论】:

      【解决方案2】:

      我一直在尝试让 google/facebook 也能正常工作。 使用弹出方法我只在 iOS (iPad Air 2) 上取得了成功,但我无法让它在 android (One Plus 2) 上工作。当我执行“ionic run android”时,它似乎可以在 Nexus 6 模拟器上运行,但仅此而已。

      $authWithOAuthPopup("google").then(function(authData) {
         $localStorage.uid = authData.uid;
         $localStorage.token = authData.token;
      
      }).catch(function(error) {
       console.log(error);
      });
      

      我尝试了 $authWithOAuthRedirect,但我的任何一个设备都没有成功

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-03
        • 2018-07-22
        • 1970-01-01
        • 1970-01-01
        • 2018-10-22
        相关资源
        最近更新 更多