I am trying to get friend list from facebook on cocos2dx game. But when I try, only available to get 25 friends. But in Facebook Graph API Test Site on facebook developer site, I can get more with limit paramter like the picture as below.
How can I implement this on Cocos2dx? The current codes are like this.
void Facebook::getFBFriends()
{
if(fb_user_id.empty() == true) return;
g_vFBFriends.clear();
std::string path = "/me";
FacebookAgent::FBInfo params;
params.insert(std::make_pair("fields", "invitable_friends"));
FacebookAgent::getInstance()->api(path, FacebookAgent::HttpMethod::Get, params, CC_CALLBACK_2(Facebook::onGetFriendsDone, this));
}
"Paging" is the keyword. Without the limit parameter, you only get the first 25 entries - and a link to get the next 25 in the JSON result.
More information: https://developers.facebook.com/docs/graph-api/using-graph-api/#paging