简体   繁体   中英

Post on multiple friend Facebook wall in iPhone

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

[_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
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM