0
votes

I am using PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) for Facebook signup/login in my iPhone app written in Swift.

UPDATE: When a new user signs up through the standard email sign up, a Session object is created as usual in the Parse Session class. However, when a new user signs up through Facebook sign up for the first time, a Session object is created then immediately deleted in the Parse Session class (after the call to saveInBackground - see my comment below). If that new users signs out then logs back in again, finally the Session object is created for some reason. What is the problem here/How can I have a Session object be created when a new Facebook user first signs up?

I've tried enabling and disabling PFUser.enableRevocableSessionInBackground() in my AppDelegate and in the Parse dashboard app settings but neither would change anything. Note: I have migrated the app to Parse Server.

1
I noticed that when I call newFBuser.saveInBackgroundWithBlock... in the PFFacebookUtils.logInInBackgroundWithReadPermissions block, the saving seems to be the reason why the Session object g ets deleted. Note: I need to save the newly created user because I am setting the fetched Facebook user details from the Facebook graph request to the newly created user. What can I do?DiligentDev

1 Answers

0
votes

This seems like the currently open issue #2105 of Parse Server.

bryhaw figured out a workaround:

Log in with the access token that is created after calling PFFacebookUtils.logInInBackgroundWithReadPermissions like so: PFFacebookUtils.logInInBackgroundWithAccessToken(FBSDKAccessToken.currentAccessToken()).

I would assume that creates a session.