Ios Parse.com - After enabling local datastore PFFacebookUtils loginWithPermission block is never called
After enabling (new) local data storage in Parse version 1.6.1 for iOS, the block in PFFacebookUtils loginWithPermission is never called.
[Parse enableLocalDatastore];
[Parse setApplicationId:@"***" clientKey:@"***"];
[PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
// Gets never called
}];
When the [Parse enableLocalDatastore] is removed, the block is called.
// [Parse enableLocalDatastore];
[Parse setApplicationId:@"***" clientKey:@"***"];
[PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
// Gets called as in previous versions
}];
I also have app switching methods to support Facebook SSO in
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication withSession:[PFFacebookUtils session]];
}
I checked the documentation and couldn't find any help. Am I missing something when I allow local data storage?
source to share
An exception may be thrown in the local data store. Try to use
[[PFFacebookUtils loginWithPermissionsInBackground: perms] continueWithBlock: ^ id (BFTask * task) {
// breakpoint
}];
and check with lldb the task to see if task.exception is null.
I have a similar problem, I can log into my application with the above method, but then if I log out when I try to log in again, I get stuck and task.exception says:
An attempt was made to change an object to one that is already known to the OfflineStore.
source to share
It might be related: https://developers.facebook.com/bugs/994229510592686/
This is a bug and will be fixed in the next Parse SDK release.
source to share