Updating/Adding/editing the Users Class when using Backendless/Facebook login...

Hi Steve,

I cannot reproduce this issue with your scenario.

First, I changed Users identity: ‘name’ instead ‘email’
http://support.backendless.com/public/attachments/63773d1aaed4606587424051d734c883.png</img>
Here is my sample code:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    
    BOOL result = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                                 openURL:url
                                                       sourceApplication:sourceApplication
                                                              annotation:annotation];
    
    FBSDKAccessToken *token = [FBSDKAccessToken currentAccessToken];
    
    @try {
        [backendless.userService loginWithFacebookSDK:token fieldsMapping:@{@"name" : @"name", @"email": @"email"}];
        BackendlessUser *user = backendless.userService.currentUser;
        NSLog(@"USER (0): %@", user);


        [user updateProperties:@{@"email" : @"James@james.com"}];
        user = [backendless.userService update:user];
        NSLog(@"USER (1): %@", user);
        [backendless.userService logout];
        NSLog(@"LOGOUT");
    }
    
    @catch (Fault *fault) {
        NSLog(@"ERROR: %@", fault);
        
    }
    
    return result;
}

Here is a log:
http://support.backendless.com/public/attachments/66db54e13a5c8b7d7651ec7fcf4d808e.png</img>

and result on application console:
http://support.backendless.com/public/attachments/84510beb84b1c54c87aebedcdc0d9159.png</img>

Please clarify, how do you get your result? Can you create sample project, which demonstrates this problem, and add it here in attachment?

Regards,
Slava

I reproduced your scenario, but only when I made a WRONG thing: set the ‘password’:

Here is a code:

    @try {
        BackendlessUser *user = [backendless.userService loginWithFacebookSDK:token fieldsMapping:fieldsMapping];
        NSLog(@"USER (0): %@", user);
        
        [user updateProperties:@{@"email" : @"James@james.com", @"password": @"qwertyuiop"}];
        user = [backendless.userService update:user];
        NSLog(@"USER (1): %@", user);


        [backendless.userService logout];
        NSLog(@"LOGOUT");
}
    @catch (Fault *fault) {
        NSLog(@"ERROR: %@", fault);
    
    }


and a log:
http://support.backendless.com/public/attachments/b6ef768ef893737f87dd68729067d51e.png</img>

Maybe you set ‘password’ somewhere in your code? Check it.

Regards,
Slava

And really - please see your comment http://support.backendless.com/t/updatingaddingediting-the-users-class-when-using-backendlessfacebook-login#comment-6947

There ‘password’ is set in “” (empty string) instead null
http://support.backendless.com/public/attachments/dc77279e5642d6315323847657764a52.png</img>

It is a cause of the problem.

dc77279e5642d6315323847657764a52.png

And i think you use the old libraries, please update them from github https://github.com/Backendless/ios-SDK/tree/master/SDK/lib or with CocoaPods.

Right thats it! Where do I sign!? You guys are like gods walking amongst mere mortals!

Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you

AWESOME STUFF!

All works as it should, thanks again… Now, There was just one more thing… LOL only joking but I am sure I will need your help again.

Have a GREAT weekend!