objective c - facebook ios api post to page - link or message -


i have created page on facebook , want post page. facebook user administrator of page. request "me/account" access_token , id page , code below posts page.

facebook* facebook = app.facebook;  nsdictionary* pg = [fbpages objectatindex:0]; // page access_token, id , name  nslog(@"page %@\n",[pg valueforkey:@"name"]);  nsmutabledictionary *params = [[nsmutabledictionary alloc] init];         nsstring *graphpath = [nsstring stringwithformat:@"%@/feed", [pg valueforkey:@"id"] ]; [params setobject:[pg valueforkey:@"access_token"] forkey:@"access_token"]; [params setobject:@"this message coming ios app." forkey:@"message"];  // ----- specify link ---------------------- [params setobject:@"link" forkey:@"type"]; [params setobject:@"http://www.whatever.com" forkey:@"link"]; // ------ difference between case 1 , 2 -----  [facebook requestwithgraphpath:graphpath andparams:params andhttpmethod:@"post" anddelegate:app]; 

now, weird thing is, (case1) if post simple message (without specify link part), appears on page posted page, (case2) when link info there, appears post.
case1 - appears on left side of timeline simple message
case2 - appears on right side of timeline "others post", , page not rendered, shows "attachment" sign.

apart 2 parameters "type" , "link", case 1 , 2 identical. experienced same issue? suggestions? doing wrong? want link posted page appear same way appears on user's wall.

ok, figured out myself. if call requestwithgraphpath token given page, works expected.

so looks like:

facebook.accesstoken = [pg valueforkey:@"access_token"]; [facebook requestwithgraphpath:graphpath andparams:params andhttpmethod:@"post" anddelegate:app]; 

obviously, need reset original accesstoken when request completed.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -