Hi is there a way to tell if a user is brand new or existing in the database when calling Backendless.sharedInstance().userService.loginWithFacebookSDK
like if the returned user object I can check if user.isNew
I need to use it for analytics purpose
Hi Olive,
For you purpose you could use the next code:
backendless.userService.loginWithFacebookSDK(
token,
permissions: permissions,
fieldsMapping: fieldsMapping,
response: { (user: BackendlessUser!) -> Void in
if user.getProperty(BACKENDLESS_USER_REGISTERED) as? NSNumber != nil {
print("NEW REGISTATION")
}
},
error: { (fault: Fault!) -> Void in
print("Server reported an error: \(fault)")
})
Regards,
Slava