1

I have migrated my iOS app (using Swift) to Parse Server and have integrated Facebook sign-up.

When a new user is created via the Facebook login, a new Session object is not created. Therefore, it does not allow the user to change their profile picture, etc. (when the user tried to update their user info, the error following is error is given:

*[Error]: cannot modify user ********** (Code: 206, Version: 1.14.2)*

Only after the Facebook user logs out and then logs back in again, the Session object is created.

How can I have it so that a Session object is created upon sign up for a new Facebook user so that they may update their user information, just like one is created via the regular standard parse login method?

Here's my code for the Facebook sign up. Note: I use the following method, update the newly created user, and then save the user:

PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
            (user: PFUser?, error: NSError?) -> Void in
...
                    user.email = someEmail
                    user.username = someUsername
                    user["profilePicture"] = someFile
...
                    user.saveInBackgroundWithBlock({
                        (succeeded: Bool, error: NSError?) -> Void in
...
}

I even tried adding/removing the PFUser.enableRevocableSessionInBackground line of code in my AppDelegate.swift but nothing changed:

// *** Initialize Parse. ***
let config = ParseClientConfiguration(block: {
    (ParseMutableClientConfiguration) -> Void in
    ParseMutableClientConfiguration.applicationId = appKey;
    ParseMutableClientConfiguration.clientKey = clientKey;
    ParseMutableClientConfiguration.server = serverURL;
});

Parse.initializeWithConfiguration(config);
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)

PFUser.enableRevocableSessionInBackground()
1
  • Did you ever figure this out? Commented Oct 21, 2016 at 1:05

1 Answer 1

0

UPDATE: Updated my Parse Server from v2.2.11 TO v2.2.22 and it seems to have fixed this issue...

Sign up to request clarification or add additional context in comments.

1 Comment

I updated but this didn't seem to solve the issue :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.