问题
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