Objective-C照片上传

时间:2014-07-09 14:36:48

标签: ios objective-c facebook

用于显示带照片的对话框的

FBDialogs功能始终返回No

我无法理解为什么......

这是代码:

UIImage* image2 = [UIImage imageNamed:[imageInfo objectAtIndex:1]];





BOOL canPresent = [FBDialogs canPresentShareDialogWithPhotos];
NSLog(@"canPresent: %d", canPresent);

FBPhotoParams *params = [[FBPhotoParams alloc] init];
params.photos = @[image2];

BOOL isSuccessful = NO;
if (canPresent) {
    FBAppCall *appCall = [FBDialogs presentShareDialogWithPhotoParams:params
                                                          clientState:nil
                                                              handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                                                  if (error) {
                                                                      NSLog(@"Error: %@", error.description);
                                                                  } else {
                                                                      NSLog(@"Success!");
                                                                  }
                                                              }];
    isSuccessful = (appCall  != nil);
}

0 个答案:

没有答案