ios - Posting photo on Facebook wall -
i trying post photo on facebook wall. using object graph api, not working successfully.
if ([posttype isequal:@"photoalbum"]) { nsstring *imgstring=[nsstring stringwithformat:@"%@%@",imgurl,[jsonresponse valueforkey:@"imageurl"]]; nsurl *url = [nsurl urlwithstring:imgstring]; nsdata *data = [nsdata datawithcontentsofurl:url]; uiimage *image=[uiimage imagewithdata:data]; nsstring*postlink =[nsstring stringwithformat:@"%@",[jsonresponse valueforkey:@"postlink"]]; [dict setobject:posttitle forkey:@"message"]; [dict setobject:image forkey:@"image"]; [dict setobject:postlink forkey:@"postlink"]; [fbrequestconnection startwithgraphpath:@"me/photos" parameters:params httpmethod:@"post" completionhandler:^(fbrequestconnection *connection ,id result ,nserror *error){ if(!error){ nslog(@"successfull"); } else{ nslog(@"unsuccess"); } }]; }
what wrong code. can please me? thanks
Comments
Post a Comment