Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Objective-C照片上传_Ios_Objective C_Facebook - Fatal编程技术网

Ios Objective-C照片上传

Ios Objective-C照片上传,ios,objective-c,facebook,Ios,Objective C,Facebook,FBDialogs显示带有照片的对话框的函数始终返回No 我不明白为什么 以下是代码: UIImage* image2 = [UIImage imageNamed:[imageInfo objectAtIndex:1]]; BOOL canPresent = [FBDialogs canPresentShareDialogWithPhotos]; NSLog(@"canPresent: %d", canPresent); FBPhotoParams *params = [[FBPho

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);
}

这是使用FaceBook Messenger.app的代码吗?是否允许此应用访问照片?然后您的应用是否应打开FaceBook Messenger.app?如果是,FaceBook Messenger.app是否允许访问Photos.app?您有什么版本的FaceBook应用程序?你是在模拟器上还是在设备上做这件事?我下载facebook sdk 3.15.1,我在模拟器上做。我下载facebook sdk 3.15.1,我在模拟器上做。