开发者

post message to users wall [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_StackOverflow中文版

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 7 years ago.

Improve this question

i am creating a iphone application using Facebook SDK.I want to post message to friends wall.can u help me to implement this..


@sai You can post a message to your friends wall by using the Facebook SDK. You just need to do following task:

  1. First find your friend's FacebookID (I assume you have it)
  2. Then do this:

-(void)sendMessageToFriendWall{

   NSString* friendID=@"here Please Add Friends FacebookID";

   NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:    
                                   friendID, @"to",messageToBePost,@"message",nil];

   [[delegate facebook] requestWithGraphPath:[NSString stringWithFormat:@"/%@

   /feed",friendID] andParams:params andHttpMethod:@"POST"  andDelegate:self];

}

If you don't have your friends's Id, you can find him and his ID using the below method call:

-(void)getFriendsandTheirId{

  [delegate.facebook requestWithGraphPath:@"me/friends" andDelegate:self]; 

}

This will return a json of friends and their facebook IDs. After getting your friend's ID, you can Post on his Wall.

Please don't Forget to Adopt FBRequestDelegate in your Controller Class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜