Using firebase auth with facebook

When I try to log into my web application while testing on my Android phone, I get this message:

"firebase.js: 75 Uncaught Error: this operation is not supported in the environment in which this application is running." location.protocol "must be http or https .."

I added my firebase code to a valid OAuth redirect URI in my fb application - https: //.firebaseio.com/ I added the application identifier and name to firebase in the auth section. Am I missing something? thank

I am using chrome remote debugging here: file: ///android_asset/www/index.html#/app/people

Maybe that's why he raises the fuss?

var provider = new firebase.auth.FacebookAuthProvider();

console.log(provider);
  firebase.auth().signInWithPopup(provider).then(function(result) {
 // This gives you a Facebook Access Token. You can use it to access theFacebook API.
   var token = result.credential.accessToken;
// The signed-in user info.
  var user = result.user;
  console.log(user, token);
  UserService.setUser(user, token);
// ...
}).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // The email of the user account used.
  var email = error.email;
  // The firebase.auth.AuthCredential type that was used.
  var credential = error.credential;
  console.log(errorCode);

  });
+4
2

Facebook, Ionic 1, Ionic 2.

Cordova cordova-plugin-facebook4 auth :

if ((window.cordova && device.platform == 'iOS') || (window.cordova && device.platform == 'Android')) {
    facebookConnectPlugin.login(['public_profile'], function(result) {
        provider = firebase.auth.FacebookAuthProvider.credential(result.authResponse.accessToken);
        Auth.$signInWithCredential(provider).then(function(authData) {
            // User successfully logged in
        }).catch(function(error) {
            // Login error
        });
    }, function(error) {
        // Login error
    });
} else {
    provider = new firebase.auth.FacebookAuthProvider();
    Auth.$signInWithPopup(provider).then(function(authData) {
        // User successfully logged in
    }).catch(function(error) {
        // Login error
    });
}

, , SDK Facebook, Firebase signInWithPopup

+3

: signInWithPopup, signInWithRedirect, linkWithPopup, linkWithRedirect getRedirectResult http/https. apis .

+1

All Articles