ios - Share image from bundle and link on Facebook in iphone -
i want share image,link etc facebook iphone app.my app link,cation,name , description posted successfully. can't share image. please follow code..
uiimage *image = [uiimage imagenamed:@"sample.png"]; nsdata *imgdata = uiimagejpegrepresentation(image, 1.0); self.dictionary =[[nsmutabledictionary alloc] initwithobjectsandkeys: @"https://www.google.com/ios", @"link", imgdata, @"data", @"appname", @"name", @"testing", @"caption", @"say this", @"description", nil];
my share facebook code is..
[facebook requestwithgraphpath:@"/me/feed" andparams:dictionary andhttpmethod:@"post" anddelegate:self];
my problem how take image bundle , how share selected image facebook?please help me..
use below:
nsstring *filepath = [[nsbundle mainbundle] pathforresource:@"image1" oftype:@"png"]; nsdata *videodata = [nsdata datawithcontentsoffile:filepath]; nsmutabledictionary *params = [nsmutabledictionary dictionarywithobjectsandkeys: @"my hat image", @"message", data, @"source", nil]; [facebook requestwithgraphpath:@"/me/photos" andparams:params andhttpmethod:@"post" anddelegate:self];
iphone ios objective-c
No comments:
Post a Comment