有没有办法将图像(UIImage)直接从 iPhone 应用程序上传到用户的墙/提要?
我看到的所有示例要么使用 json 嵌入式链接,要么使用带有相册 ID(辅助)的 photos.upload 调用,这导致用户在他的相册中获取图像。
我想要做的是上传(由用户)在 iPhone 应用程序中创建的(UI)图像并上传到他/她的墙上。这可能吗?示例代码将不胜感激。
This isn't possible. To understand why, you have to consider the conceptual model that Facebook currently uses: Posts on a user's wall are just bits of text optionally attached to some link URL. That link URL can be some random image on the web, or it can just as well be an image that the user already has in their photo albums.
But a wall post cannot inherently "contain" an image in and of itself. Therefore you need to host the image somewhere, be it on your own site, or on Facebook itself, inside one of the user's albums by uploading it first to there.
我自己也想弄清楚同样的事情。我确实发现的一件事是,如果您发布“Wall Photos”相册,它们确实会被发布到墙上。但是,如果您之前从个人资料页面将照片上传到您的墙上,则您只有一个墙相册。即使那样,您也需要获得专辑帮助,然后发布到它。
编辑
找到了一个更好的解决方案。首先将照片上传到您的默认相册,然后在墙上发布一个帖子,其中包含上传时返回的照片链接(不是指向图像的链接,而是图像所在的页面)。