2015-05-21 77 views
0

我試圖發佈時有一個用戶非常奇怪的行爲。 (ipad 2,ios8.3,parse 1.7.4)linkUserInBackground返回成功爲NO

(來自我的設備,一切正常)。

bGranted_publish_actions =總是假 bGranted_user_photos =總是假

當我打電話linkUserInBackground,我可以看到Facebook的應用程序打開(很長),然後關閉直接(不活動的時候,看到的許可屏幕),和我的iOS應用程序重新打開。 錯誤=零 成功=否

任何想法?

-(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]; 
    } 
} 

回答