easyLoginWithFacebookFieldsMapping: Fetching facebook firstName for user

I’m trying to login to facebook using backendless easyLogin* method in Swift and to get user name to display further. I’m able to login successfully but can’t get the name. The code is as the following (“first_name” is facebooks graph field to map):
let backendless = Backendless.sharedInstance();

backendless.userService.easyLoginWithFacebookFieldsMapping(
[“email”:“email”, “first_name”:“displayName”], permissions: [“email”, “public_profile”],
response: {(result : NSNumber!) -> () in
print (“Result: (result)”)
},
error: { (fault : Fault!) -> () in
print(“Server reported an error: (fault)”)
})
What am I missing here?

Please try this method:

 
 func easyFacebookLogin() {
 
 let fieldsMapping = [
 "name" : "name",
 "first_name": "first_name",
 "last_name" : "last_name",
 "email": "email"]
 
 backendless.userService.easyLoginWithFacebookFieldsMapping(
 fieldsMapping,
 permissions: ["email"],
 response: {(result : NSNumber!) -> () in
 print ("Result: \(result)")
 },
 error: { (fault : Fault!) -> () in
 print("Server reported an error: \(fault)")
 })
 }

You also could investigate our UserSocial sample (on objective-C) - it shows how easyLogin… can be organized.
You can check how it works with our Backendless app, then try with your one.

Thanks for your fast response. I’ve run the code you’ve suggested but got the same results - neither new fields appeared in backendless console nor they populated in any way.

However once I’ve removed a previously logged in facebook user from user table in backendless and logged in again using the code snippet above, everything worked as expected - name was mapped to full name (instead of facebook user id) and first_name/last_name also appeared in the user table as expected.