Firebase AngularFire Facebook Login no login transports available error

我们两清 提交于 2019-12-13 21:32:35

问题


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

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

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

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:

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

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.

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


回答1:


Just realized I still have this question unanswered:

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.



来源:https://stackoverflow.com/questions/31642300/firebase-angularfire-facebook-login-no-login-transports-available-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!