简体   繁体   English

Facebook iOS SDK分享来自App的图片

[英]Facebook iOS SDK share picture from App

I try share picture to Facebook. 我尝试分享图片到Facebook。 This is work. 这是工作。

 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   kAppId, @"app_id",
                                   url, @"link",
                                  @"http://yandex.st/morda-logo/i/logo.png", @"picture",
                                   title, @"name",
                                   produc, @"caption",
                                   tempString, @"description",
                                   message, @"message",
                                   nil];

But I want share picture from my App. 但我想从我的应用程序分享图片。 I try 我试试

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   kAppId, @"app_id",
                                   url, @"link",
                                  [UIImage imageNamed:@"nav.png"], @"picture",
                                   title, @"name",
                                   produc, @"caption",
                                   tempString, @"description",
                                   message, @"message",
                                   nil];

But I have problem: 但我有问题:

:frame:decisionListener: delegate: -[UIImage length]: unrecognized selector sent to instance 0xc98b1d0 :frame:decisionListener:delegate: - [UIImage length]:发送到实例0xc98b1d0的无法识别的选择器

What am I doing wrong? 我究竟做错了什么? Thank you very much 非常感谢你

Try using "source" and not "picture". 尝试使用“来源”而不是“图片”。 Picture is expecting the url string. 图片期待网址字符串。

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   kAppId, @"app_id",
                                   url, @"link",
                                  [UIImage imageNamed:@"nav.png"], @"source",
                                   title, @"name",
                                   produc, @"caption",
                                   tempString, @"description",
                                   message, @"message",
                                   nil];

Hmm I am not user Facebook gonna decode your bitmap image, save the image on their server and make it available on your wall ^^ 嗯,我不是用户Facebook会解码你的位图图像,将图像保存在他们的服务器上,并让它在你的墙上可用^^

Try an URL instead of the NSData data of your image. 尝试使用URL而不是图像的NSData数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM