如何使用FBConnect对话框方法将UIImage发布到我的墙上? [英] How to use FBConnect dialog method to post a UIImage to my wall?

查看:54
本文介绍了如何使用FBConnect对话框方法将UIImage发布到我的墙上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(注意:),我已经遍历了所有内容,其中有很多示例,它们介绍了如何通过对话框将URL转换为图像,以及一些有关如何将图像发布的方法,数据直接发送到相册,但我都不想这样做.)

(Note: I've looked all over for this, and there are tons of examples for how to post a URL-to-image via dialog, and a few for how to post image-data direct to photo album, but neither of those are what I'm trying to do.)

我可以使用以下类似的代码轻松发布存储在网络上的图像:

I can post an image that's stored on the web easily enough with code similar to this:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
        @"This is what I say about kittens!", @"message",
        @"Kittens!", @"name",
        @"I'm feeling fuzzy", @"caption",
        @"You, too, can feel fuzzy, with FuzzyKitten™", @"description",
        @"http://example.com/fuzzykitten.html", @"link",
        @"http://placekitten.com/200/150", @"picture",
        nil];

[facebook dialog: @"feed"
            andParams: params
            andDelegate: self];

一切正常.问题是,我想替换:

And everything works fine. The problem is, I'd like to replace:

        @"http://placekitten.com/200/150", @"picture",

包含以下内容:

        [UIImage imageNamed: @"myImage.png"], @"picture",

那当然是不对的.所以我的问题是:如果我有UIImage形式的图像,如何将其加载到参数字典中以传递给dialog方法?

which, of course, isn't right. So my question is: If I have an image in UIImage form, how do I load that into the parameters dictionary to pass to the dialog method?

谢谢!

这是一个没有服务器的客户端iPhone应用,因此,将图像作为两部分过程的第1部分上传到FB很好,但是我现在不知道了解如何查找上传的图片的URL.再次感谢!

This is a client iPhone app for which there is no server so, while uploading the image to FB as part-1 of a 2-part process is fine, I'm now not seeing how to find the uploaded image's URL. Thanks again!

推荐答案

您不能直接将图像上传到墙上,当发布到墙上时,您只能将图像链接到墙上.
因此,您需要先将UIImage上传到某个地方.您有2个选择:
1.上传到您的/某些服务器并发布链接到该服务器的墙上帖子.
2.上载到Facebook相册.检查图形API 来做到这一点,这非常简单.

You can't directly upload an image to the wall, when publishing to the wall you can just link an image to it.
So, you need to upload the UIImage somewhere first. You have 2 options:
1. Upload to your/some server and publish a wall post linking to it.
2. Upload to a facebook album. Check the graph API about doing that, it is pretty straightforward.

您不再能够获取托管在Facebook CDN(可能还有其他CDN)中的图像,因此,如果需要从对话框链接图像,则应将其上传到服务器上并从那里获取永久链接

edit: you can no longer source images hosted in facebook CDN (and probably other CDNs), so if you need to link an image from a dialog you should upload it on a server and get a permalink from there

这篇关于如何使用FBConnect对话框方法将UIImage发布到我的墙上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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