简体   繁体   中英

Facebook iOS SDK share picture from App

I try share picture to 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

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 ^^

Try an URL instead of the NSData data of your image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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