IOS Development: How can I get a wall post on Facebook to show friends in the news feed?

I integrate Facebook into my application for iPhone, and I have a code for posting to the user's wall after logging in, but I noticed that the message does not appear in the news feed of the user who was seen from the user's friends. Instead, it appears only on the user's wall. Here is my code ...

- (void)publishStream { NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Post a message on your wall", @"user_message_prompt", @"Hello, World!", @"message", nil]; [facebook dialog:@"feed" andParams:params andDelegate:self]; } 

How can I find it in the news feed? I should mention that the only permission I set is "publish_stream", which, as I understand it, is the only permission I need.

Thank you very much for your wisdom!

+7
ios iphone facebook ipad
source share
1 answer

You need to send a message to your friends, a simple way would be to adapt your code to use the corresponding graph method with the persons you want to send to facebook ID (I assumed that you saved this api in person.facebookID chart from a previous call)

 [facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed/",person.facebookID] andParams:params andHttpMethod:@"POST" andDelegate:self 

http://developers.facebook.com/docs/reference/api/post

To get a list of friends of users, use the path on the schedule me / friends

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

Which will return a JSON list of Facebook friends ’user names and their Facebook identifiers corresponding to the delegate method from FBRequest, it’s probably worth wrapping this result set in a set of personal objects or saving the returned NSDictionary so that you can retrieve individual friends before you process the list of returned friends (you probably want to use a UITableView to display the user's friends or filter based on some other input from the user)

Using this method will mean that you do not need to use Facebook dialog boxes in iOS sdk, which means that there is an upper limit to the number of messages that a user can send in one day using your application.

If you want to use the dialog, you will need to include "target_id" in the params dictionary and set it for the Facebook ID you want to send to

+4
source share

All Articles