I have a very strange behaviours with one user when trying to post. (ipad 2, ios8.3, parse 1.7.4)
(from my device, all ok).
bGranted_publish_actions = always false bGranted_user_photos = always false
When I call linkUserInBackground, i can see the facebook app opening(very long), and then close directly(not event the time to see the permission screen), and my ios app reopen. error=nil succeeded= no
Any idea?
-(void)postShareToFacebookWithDescription:(NSString *)description andBlock:(void (^)(NSError *))completionBlock{
NSLog(@"ℹ️--[%s:%d]",__PRETTY_FUNCTION__,__LINE__);
bool bGranted_publish_actions=[[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"];
bool bGranted_user_photos=[[FBSDKAccessToken currentAccessToken] hasGranted:@"user_photos"];
if (!bGranted_user_photos || !bGranted_publish_actions ){
//withPublishPermissions:@[@"publish_actions", @"user_photos"
[PFFacebookUtils linkUserInBackground:[PFUser currentUser] withPublishPermissions:@[@"publish_actions"] block:^(BOOL succeeded, NSError *error) {
if (succeeded) {
NSLog(@"User now has read and publish permissions!");
[self postDataWithPhoto:nil];
} else {
if (completionBlock) {
completionBlock(error);
}
}
}];
} else {
NSLog(@"Got Facebook publish permissions and about to share");
[self postDataWithPhoto:nil];
}
}