How can I get all friends’ last statuses in one batched request? I tried the following but it is not working:
FacebookClient _FacebookClient = new FacebookClient ( Settings.AccessToken );
FacebookClient.PostCompleted += new EventHandler<FacebookApiEventArgs> ( _FacebookClient_PostCompleted );
FacebookClient.BatchAsync
(
new FacebookBatchParameter [ ]
{
new FacebookBatchParameter( HttpMethod.Get , "/me/friends" , new Dictionary<string , object> { { "fields" , "id , name , picture" } } ) { Data = new { name = "one-friend", omit_response_on_success = false } } ,
new FacebookBatchParameter{ Parameters = new { ids = "{result=one-friend:$.data.0.id}" } },
new FacebookBatchParameter("{result=one-friend:$.data.0.id}/statuses", new Dictionary<string , object> { { "limit" , "1" } , { "data" , "0" } , { "fields" , "message" } } )
}
);
I can answer your question using FQL, which is on my opinion much simplier. I used FacebookWebclient, but FacebookClient should work the same way.
FacebookWebClient fb = new FacebookWebClient();
Note:
http://developers.facebook.com/docs/reference/fql/status/
“The status table is limited to the last 30 days or 50 posts, whichever is greater.”
And of course you need the permissions for: friends_status