ios - 在sdk 3.14中在用户的facebook feed中发布照片

时间:2014-06-19 09:54:54

标签: ios facebook sdk facebook-sdk-3.14.x

在sdk 3.14中在facebook上传/发布照片方面需要帮助。

大多数工作代码在旧的sdk版本中已弃用,我无法找到一个简单的例子。

[编辑]这是我目前的进展。

- (void) handleTakePictureTouch:(id)sender
{
    NSLog(@"Take Picture");

    UIImagePickerController *imagePicker =   [[UIImagePickerController alloc] init];

    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
       [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
    else
        [imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];

    [imagePicker setDelegate:self];

    [self presentViewController:imagePicker animated:YES completion:nil];
}


- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    [picker dismissViewControllerAnimated:YES completion:nil];
    UIImage *img    =   [info objectForKey:UIImagePickerControllerOriginalImage];
    [self.imgvPhoto setImage:img];
}


- (void) handleShareFacebook:(id)sender
{
    NSLog(@"Share FB");

}

1 个答案:

答案 0 :(得分:0)

阅读文档后,我在facebook sdk 3.14.x

中找到了样本共享

此处:https://github.com/fbsamples/ios-howtos/blob/master/FBShareSample/FBShareSample/ShareViewController.m