Error in facebook login

Ok Alex, now using null:

Failed to load resource: the server responded with a status of 400 (Bad Request)

https://api.backendless.com/v1/users/social/facebook/login/7513F64B-6A12-0BB7-FF65-A536A9574A00

    code: 3022 message: "Unable to login user due to error: Unable to register user. Property 'name' is required" statusCode: 400

Raul, probably you’ve set field “name” as required in your app?
If so, try to unset it and test again, or add mapping to request.

Hi Alex,

Thank you very much for your help, the login is working. I have two more questions:

1 - Just name and email is returning, the other is empty. I’m doing something wrong?

var mapping = {
            'first_name': 'name', 
            'email': 'email', 
            'picture': 'image', 
            'address': 'address', 
            'about': 'description',
            'city': 'city'
        }

2 - When I give refresh the page the session is not saved, the ‘stayLoggedIn’ does not work?

Hello, Raul!

  1. Mapping works for case of registering new user. If only login is performed - only properties which has been used while registering would be returned. Try calling this function with mapping for new user to see what I mean.
  2. Unfortunately, stayLoggedIn feature cannot be used with social login for now.
    best regards,
    Alex

Alex,

  1. I made this test in another login and still not working.

  2. Ok, there will be something in the future? My users will need to sign in with facebook whenever they are opening the application.

Hello, Raul!

  1. Looks strange, I’ve checked that twice. Try the following: register user with some mapping; remove this user; change mapping; register him again.
  2. Yes, we shall discuss it. It would appear in future release.

best regards,
Alex

Hi…

Getting undefined when try to integrate facebook with backendless.
this how i have written

function callback(user){
console.log(user);
}
function gotError( err ){
// see more on error handling
console.log( "error message - " + err.message );
console.log( "error code - " + err.statusCode );
}
$scope.login = function(){
permissions = “email”;
facebookFieldsMapping = {email:“email”};
Backendless.UserService.loginWithFacebook(facebookFieldsMapping, permissions, new Backendless.Async(callback, gotError));
}

    }

I am new to backendless. Please let me know if i have done any mistake.
Thank you.

Once click on the button(“login”) it will open dialogbox with facebook login window. Once we give the correct credentials the dialog box will get exit. If we see in network the status code was 200.

Hi Anusha,

As I understood you are developing an ionic-app, right?

Regards Ilya