使用Facebook iOS SDK在用户墙上张贴照片 [英] Post photo on user's wall using Facebook iOS SDK

查看:92
本文介绍了使用Facebook iOS SDK在用户墙上张贴照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将照片从相机上传到用户的Facebook墙。我不完全确定什么是正确的策略,但是从阅读周围,似乎要做的是将照片上传到相册,然后有人在墙上发送一张该相册/照片的链接。理想情况下,这将涉及到对话框,但从我可以告诉这是不可能的。



我设法将照片上传到相册,并返回一个ID那张照片,但我不知道该怎么办。



任何人都可以提供一些直接的代码来实现这一点?



奖金问题:是否可以将照片发布到应用程序墙上(或者替代)?​​



编辑:图API优先,但任何在这个阶段工作的东西都是好的。

解决方案

更清楚你想做什么 - 向FB发布照片,并保证一个帖子在用户的墙上/流上。



不幸的是,有一些事情在路上。



FB Graph API似乎只允许您将照片发布到相册,或直接发布到墙上,链接到网络上已存在的图片。在第一种情况下,流中的帖子可能会被发出,但FB似乎以某种方式整合多个帖子,以防止用户的流被轰炸。在第二种情况下,您可能会认为您可以放弃发布到相册,然后显式地发布一个相册。链接到相册。您可以向原始相册帖子no_story添加一个参数,值为1,并且在准备创建明信片时抑制可能发生的墙贴。但是,FB不会有一段时间内新发布的图像的源URL,AND似乎并不喜欢包含自己的内容传递网络的URL,返回错误。您可能会考虑简单地将流程中的状态更新,谈论该帖子,但是,Graph API每天还限制在每天25个这样的直接Feed帖子中,以防止垃圾邮件。



一个解决方案是发布到Flickr这样的东西,获取图像的URL,然后发布到墙上。 FB的首选解决方案似乎是使用作为移动工具包一部分的FB对话框 - 基本上是一些非常像OAuth屏幕的网页。



个人而言,我打算简单地按照上述方式发布到专辑,并与FB的用户应该如何通知的想法一起生活。好奇你如何选择继续。


I'm trying to upload a photo from the camera to a user's Facebook wall. I'm not entirely sure what the correct strategy is, but from reading around it seems the thing to do is upload the photo to an album, and then someone post on the wall a link to that album/photo. Ideally this would involve the dialog, but from what I can tell that's not possible.

I've managed to upload a photo to an album, and get back an ID for that photo, but I'm not sure what to do after that.

Can anyone provide some straightforward code for achieving this?

Bonus question: Is it possible to post the photo to the application wall, as well (or instead)?

Edit: Graph API is preferable, but anything that works at this stage is good.

解决方案

It's clearer what you wish to do - post a photo to FB, and guarantee that a post goes on the user's wall/stream.

Unfortunately, there are some things in the way.

FB Graph API appears to only allow you to post EITHER a picture to an album, or post to the wall directly, linking to a picture already existing somewhere on the web. In the first case, a post in the stream will probably be made, but FB appears to consolidate multiple posts in some manner so as to keep the user's stream from being bombarded. The mechanism for this is not documented anywhere I could see.

In the second case, you might think you could get away with posting to an album, and then explicitly posting a link to the album. You can add a parameter to the original album post, "no_story" with a value of 1, and suppress the wall post that might be made while you prepare to make an explicit one. However, FB will not have the source URL for a newly posted image for a while, AND, it doesn't appear to like URLs that include its own content delivery network, returning an error. You might think to simply put status update in the stream, talking about the post, However, the Graph API is also limited to 25 such direct feed posts per day per app, to prevent spamming.

One solution would be to post to something like Flickr, get the URL of the image, and then post to the wall. FB's preferred solution appears to be to use the FB dialogs that are part of the mobile toolkit - essentially little web pages much like the OAuth screen.

Personally, I plan to simply post to the album as above, and live with FB's idea of how the user should be notified. Curious how you choose to proceed.

这篇关于使用Facebook iOS SDK在用户墙上张贴照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆