-1

在 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");

}
4

1 回答 1

0

阅读文档后,我在 facebook sdk 3.14.x 中找到了一个示例共享

这里:https ://github.com/fbsamples/ios-howtos/blob/master/FBShareSample/FBShareSample/ShareViewController.m

于 2014-06-20T09:27:37.617 回答