0

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];
    }
}
Franck
  • 8,939
  • 8
  • 39
  • 57

1 Answers1

0

I got my answer: FBSDKLoginManager logInWithPublishPermissions always returns isCancelled=YES

"This can happen when your Facebook App doesn't have "publish_actions" permission, or you're not using a test user."

Community
  • 1
  • 1
Franck
  • 8,939
  • 8
  • 39
  • 57