I know there were issues when we put in the Facebook ID when mapping the fields for Facebook Login and I saw a note on the fix for it. Is it recommended to map the facebook ID and put it into Backendless manually in the field mapping section of the facebook login function or should we not put it in?
We do need to have the facebook ID in backendless. That is very important. If we do not map it ourselves, will it automatically be put into Backendless?
let fieldsMapping = [
"id" : "facebookId",
"name" : "name",
"first_name": "firstName",
"last_name" : "lastName",
"gender": "gender",
"email": "email"
]
Hi Nevin,
in any case, Facebook ID will automatically be added to the socialID column, which is important for our system and will be used when the user logs in as its identifier. There is no way to remove this column, because it is a system column.
Why is it so important this field to not present in the table?
Regards,
Stanislaw
So do you recommend us to put it in field mapping section or not? It is very important that this field is present in the table. I am also not seeing a social ID column only an “id” column and a “socialAccount” column. Are both the “id” column and a “socialAccount” column system columns? Does Backendless put the id into the “id” column if there is not field mapping for Facebook ID in our code?
so should it look like this
let fieldsMapping = [
"id" : "facebookId",
"name" : "name",
"first_name": "firstName",
"last_name" : "lastName",
"gender": "gender",
"email": "email"
]
or like this?
let fieldsMapping = [
"id" : "facebookId",
"name" : "name",
"first_name": "firstName",
"last_name" : "lastName",
"gender": "gender",
"email": "email"
]
Also when I have this line of code using swift and backendless 4 with the latest version of the iOS SDK that was released yesterday I think. I get nil even if the user is logged in with facebook. I make an API call to get the same data and I get the correct data but using the iOS SDK, I get nil. I have tried to login and log out but that also does not help.
I also don’t see “socialAccount” in the user schema.
let socialLogin = backendless?.userService.currentUser.getProperty("socialAccount")
By socialId
I meant id
column which is created automatically by system and contains social id (facebook id in your case). Backendless automatically put value into it, so you don’t have to make it manually through fieldsMapping.
Hello Nevin,
You can’t get socialAccount directly from currentUser but you can retrieve it this way:
let currentUser = backendless.userService.currentUser
let socialAccount = (backendless.data.of(BackendlessUser.ofClass()).find(byId: currentUser?.objectId) as! BackendlessUser).getProperty("socialAccount") as! String
Regards, Olga