Reputation: 11782
I am trying to post a message on all of my friends wall
Following is the code that ih ave found
[_facebook requestWithGraphPath:@"friend_ID/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];
The big problem is how can i get friend_id
? is it their emails? Or how to get all lists of my friends ids
Upvotes: 0
Views: 267
Reputation: 108101
[_facebook requestWithGraphPath:@"me/friends" andDelegate:self];
will request the list of your friends, provided that you are correctly authenticated.
Then implement your delegate method in order to extract the id you need.
- (void)request:(FBRequest *)request didLoad:(id)result {
items = result[@"data"];
for (NSDictionary * friend in items) {
long long friendId = [friend[@"id"] longLongValue];
// Do something with the Id
}
}
Upvotes: 2