如何在Facebook上发布对话文本的本地图片 [英] How to post local image with dialog text in facebook

查看:709
本文介绍了如何在Facebook上发布对话文本的本地图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@https://developers.facebook.com/docs/reference/dialogs/,@link,
@http://fbrell.com/f8.jpg,@picture,
@Facebook对话框,@名称,
@参考文档,@caption,
@使用对话框与用户交互,@description,
nil];

AppDelegate * delegate =(AppDelegate *)[[UIApplication sharedApplication] delegate];
[[委托Facebook]对话框:@feed
andParams:params
andDelegate:self];

现在我想以同样的方式从本地图像上传图片



喜欢

  profImg = [UIImage imageNamed:LoginWithFacebookNormal@2x.png]; 
NSData * data = [NSData dataWithData:UIImagePNGRepresentation(profImg)];

我使用了数据,@图片,在字典中,但它给我错误



是否有任何其他方式上传本地/画廊/资源图像与对话框box + comment area?



我搜索过,但每次发现只有url图像可以提供对话框



我已经使用Hackgraph教程来发布这个帖子。



注意:我没有使用Sharekit或任何其他API,我只使用Graph API

解决方案

最后经过大量的研究,我得到了Facebook的例子,从这里。您必须进行修改,因为当前示例保留静态图像。


I have upload images with url image successful on this way

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"https://developers.facebook.com/docs/reference/dialogs/", @"link",
                               @"http://fbrell.com/f8.jpg", @"picture",
                               @"Facebook Dialogs", @"name",
                               @"Reference Documentation", @"caption",
                               @"Using Dialogs to interact with users.", @"description",
                               nil];

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] dialog:@"feed"
           andParams:params
         andDelegate:self];

Now i want to upload image from a local image in same way

like

    profImg = [UIImage imageNamed:LoginWithFacebookNormal@2x.png"];
    NSData *data = [NSData dataWithData:UIImagePNGRepresentation(profImg)];

i have used data, @"picture", in dictionary but it's give me error

is it any other way to upload local/Gallery/resource image with dialog box + comment area ?

I have searched but every time found that only url image can feed the dialog box

I have used Hackgraph tutorial for this posting.

Note: I am not using Sharekit or any other API i have used only Graph API

解决方案

Finally after lots of research I get the example of Facebook. Download the example from here. You have to make modification because currently example hold static image.

这篇关于如何在Facebook上发布对话文本的本地图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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