0

すべての友達ウォールにメッセージを投稿しようとしています

以下は、私が見つけたコードです

 [_facebook requestWithGraphPath:@"friend_ID/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

大きな問題は、どうやって手に入れることができるfriend_idかです。それは彼らのメールですか?または、友達IDのすべてのリストを取得する方法

4

1 に答える 1

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

あなたが正しく認証されていれば、あなたの友達のリストを要求します。

次に、必要な ID を抽出するためにデリゲート メソッドを実装します。

- (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
    }
}
于 2013-01-27T19:11:27.673 に答える