Firebase AngularFire Facebook 登录没有登录传输可用错误 [英] Firebase AngularFire Facebook Login no login transports available error

查看:23
本文介绍了Firebase AngularFire Facebook 登录没有登录传输可用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Firebase 的 AngularFire,并尝试使用我在他们的 Facebook 登录文档中找到的一些代码登录.

I'm currently using Firebase's AngularFire and trying to login with some code I found in their documentation for facebook logins.

这是我的 html 代码(使用 ng-click 开始登录):

This is my html code (with ng-click to start login):

 <a ng-click="loginWithFacebook()" class="btn btn-block btn-social btn-facebook">

这是我的 angularjs 代码的样子(我已经设置了一个登录控制器):

This is what my angularjs code looks like (I've set up a login controller):

 var app = angular.module("loginApp", ["firebase"]);

 app.controller("loginCtrl", function($scope, $firebaseObject) {
 var ref = new Firebase("firebaseUrl");

$scope.loginWithFacebook = function() {
    ref.authWithOAuthPopup("facebook", function(error, authData) {
    if (error) {
        console.log("Login Failed!", error);
        alert("That didn't work");
      } else {
        console.log("Authenticated successfully with payload:", authData);
        document.write("You're logged in!");
      }
    });
};

因此,当我单击时,该按钮可以正常工作,但它不断向我显示此错误消息:

So when I click, the button works except it keeps giving me this error message:

错误:请求的方法没有可用的登录传输.在错误(本机)在 yg (https://cdn.firebase.com/js/client/2.2.4/firebase.js:139:1271)在 https://cdn.firebase.com/js/客户端/2.2.4/firebase.js:160:141

Error: There are no login transports available for the requested method. at Error (native) at yg (https://cdn.firebase.com/js/client/2.2.4/firebase.js:139:1271) at https://cdn.firebase.com/js/client/2.2.4/firebase.js:160:141

我查看了 firebase 的文档,错误消息和解释非常神秘,我不知道它是什么意思.

I've taken a look in the documentation for firebase, and the error message and explanation is pretty cryptic and I have no idea what it means.

有人能告诉我发生了什么以及我如何能够使用 Facebook 登录并调用 Facebook 弹出窗口吗?

Could someone tell me whats going on and how I can be able login using Facebook and invoke a Facebook popup?

推荐答案

刚刚发现我还有这个问题没有回答:

Just realized I still have this question unanswered:

我实际上意识到这仅仅是因为我没有设置 Web 服务器来处理对 Firebase 的 API 调用,这是我的一个愚蠢的错误,我将把它留在这里供未来的 Firebase 用户使用,以便他们理解您必须使用 nodejs/rails 或其他后端框架来处理 API 调用,或者使用 Github Pages 之类的东西来在线托管您的代码.

I actually realized that it was merely because I didn't have a Web server set up to handle API calls to Firebase, it was a silly mistake on my part and I will leave this here for future Firebase users so that they understand that you would have to either use nodejs/rails or other backend frameworks to handle API calls or use something like Github Pages to just host your code online.

这篇关于Firebase AngularFire Facebook 登录没有登录传输可用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆