我具有集成的FBSDKShare用于共享图像。我只能共享一个图像,但我想共享多个图像

我正在使用的代码

    FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
    FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
    FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];

    for( int i = 0; i < (int)pActiveSession.aShotImages.count; i++ )
    {
        UIImage *image = [UIImage imageWithData:pActiveSession.aShotImages[i]];
        [pActiveSession.allShotImages addObject:[self resizeImage:image]];

    }
    content.photos = pActiveSession.allShotImages;
    photo.userGenerated = YES;
    dialog.mode = FBSDKShareDialogModeNative;
    dialog.fromViewController = self;
    [FBSDKShareDialog showFromViewController:self
                                     withContent:content
                                        delegate:nil];


我得到的错误

ios - 在FBSDK“共享”对话框中共享多个图像-LMLPHP

提前致谢。

最佳答案

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
  UIImage *image = info[UIImagePickerControllerOriginalImage];

  FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
  photo.image = image;
  photo.userGenerated = YES;
  FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
  content.photos = @[photo];
  ...
}


根据Facebook集成文档,人们需要安装iOS 7.0或更高版本的本地Facebook应用程序

关于ios - 在FBSDK“共享”对话框中共享多个图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55706373/

10-13 08:44
查看更多