Hi , I am building an ionic 3 app with cordova support.
I have integrated the facebook login using cordova plugin (https://github.com/jeduan/cordova-plugin-facebook4) , and it works fine.
Now I am using backendless 4 to persist this fetched facebook user details.
Ref doc : https://backendless.com/docs/js/doc.html#users_facebook_login
My code looks like this
facebookLoginCordova() {
this.facebook.login(['public_profile', 'user_friends', 'email',])
.then(res => {
var userId = "/" + res.authResponse.userID + "?fields=name,first_name,last_name,email,picture"
this.facebook.api(userId,['public_profile']).then(res => {
this.user = res
this.loginFBBackendless()
})
console.log('Logged into Facebook!', res)
}).catch(e => console.log('Error logging into Facebook', e));
}
loginFBBackendless() {
var facebookFieldsMapping = {
email : 'email',
name : 'name',
first_name: ' first_name',
last_name : 'last_name'
}
Backendless.UserService.loginWithFacebookSdk(facebookFieldsMapping,true)
.then( res => {
this.message = "Successfully saved user to backendless"
console.log("Successfully saved user to backendless")
})
.catch( function( error ) {
this.message = "Error while saving user to backendless"
console.log("Error while saving user to backendless")
});
}
I am unable to persist the user , there is no error either. I tested the Backendless connectivity with the TestTable
Backendless.Data.of('TestTable').save({ foo: 'bar' })
and this worked and i can see the table entries in the backendless console.
Am I doing something wrong or is it issue with backendless 4 for ionic.