ios - Publish an image with text on facebook -


i post feed on facebook using fallback share. should contain image , message. have tried soo changing params

 nsmutabledictionary *postparams = [[nsmutabledictionary alloc] initwithobjectsandkeys:  @"http://www.abc.com",@"link",  self.produtobj.productimageurl, @"picture",  self.produtobj.productname, @"name",  self.produtobj.productdescription, @"message",  nil];  [fbrequestconnection  startwithgraphpath:@"me/feed"  parameters:postparams  httpmethod:@"post"  completionhandler:^(fbrequestconnection *connection,                      id result,                      nserror *error) {      nsstring *alerttext;      if (error) {          alerttext = [nsstring stringwithformat:                       @"error: domain = %@, code = %d",                       error.domain, error.code];      } else {          alerttext = [nsstring stringwithformat:                       @"posted action, id: %@",                       [result objectforkey:@"id"]];      }      // show result in alert      [[[uialertview alloc] initwithtitle:@"result"                                  message:alerttext                                 delegate:self                        cancelbuttontitle:@"ok!"                        otherbuttontitles:nil]       show];  }]; 

with code, feed displayed in box , clicking on taking me link spcified. want have image thumbnail story not inside box. please me. first question in sof. please forgive me mistakes. in advance. :)

i prefer use uiactivityitemviewconroller pushing stuff facebook.

the user needs logged facebook on device. can through settings in facebook section.

i make new controller stuff:

    nsmutablearray *stuff = [[nsmutablearray alloc]init];     nsstring *textstring = @"now time men come aid of country. lorum ipsum etc";     uiimage *pic = [uiimage imagenamed:@"icon-small-50"];//a local image     nsstring *url = @"http://nwc.co/images/nwc-icon-200.gif";//a link image     [stuff addobject:textstring];     [stuff addobject:pic];     [stuff addobject:url];     uiactivityviewcontroller *vc = [[uiactivityviewcontroller alloc]initwithactivityitems:stuff applicationactivities:nil];      [self.navigationcontroller presentviewcontroller:vc animated:yes completion:^{         //do here when done        }]; 

if run above, you'll notice text, local image, , link online image appear on post. , can exclude other activities, if don't want confuse people when activity icons pop up:

vc.excludedactivitytypes = @[uiactivitytypeprint, uiactivitytypeposttotwitter, uiactivitytypeposttoweibo, uiactivitytypemail, uiactivitytypecopytopasteboard, uiactivitytypeassigntocontact, uiactivitytypesavetocameraroll]; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -