【问题标题】:adding photo on facebook wall在 Facebook 墙上添加照片
【发布时间】:2010-09-25 13:20:39
【问题描述】:
- (void)postToWall {
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];

dialog.userMessagePrompt = [NSString stringWithFormat: subjectTitle]; //subjectTitle works here but not as name where i need it.

NSString *src = @"http://www.sample.com/image.png";
NSString *name = storyLink;  //<---------------------------------works with storyLink but not subjectTitle. I need subjectTitle to work here
NSString *href = storyLink;

NSString *attachment = [NSString stringWithFormat:@"{\"name\":\"%@\",\"media\":[{\"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\"}]}", name, src, href];
dialog.attachment = attachment;
[dialog show]; 
}

我想将http://www.sample.com/image.png 的照片库中的图片添加到 Facebook 墙上。

谁能帮帮我....

提前致谢......

【问题讨论】:

标签: iphone objective-c ios4


【解决方案1】:

您可以使用 UIImagePickerController 及其委托方法访问 iPhoto 库项目的 URL。

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

当用户选择一张照片时,该 URL 将在字典中的键 UIImagePickerControllerMediaURL

【讨论】:

  • 您好,在字典信息中,键 UIImagePickerControllerMediaURL 的值为 NULL。我在这里错过了什么吗?
  • 您好,您有没有打开选择器界面并从中选择图像?并且你已经设置了选择器控制器的委托?
  • 你能让这个工作吗?我尝试在 NSTemporaryDirectory() 中使用图片的 URL,它没有显示出来......不确定这是否是同一个问题,我在 stackoverflow.com/questions/5137285/… 发布了这个
  • 试图让它与所描述的照片选择器一起工作,但无法让它工作......您使用的是 facebook connect 还是新的图形 API?
【解决方案2】:

这个Stack Overflow Question about uploading images to Facebook 可能对你有帮助。

Sharekit 也是一个不错的框架,可以为您的 iPhone 应用程序添加社交功能。我认为它具有共享图像的功能。你可以在Sharekit official website查看。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多