Facebook plugin - get list of friends

Hi
if facebook app in not installed then else block of below code will execute and share photo.

FacebookAgent::FBInfo params;
params.insert(std::make_pair("dialog", "sharePhoto"));
params.insert(std::make_pair("photo", outputFile));
//param required for else block only
params.insert(std::make_pair("name", "My Game"));
params.insert(std::make_pair("caption", "New Coocs2dx game"));
params.insert(std::make_pair("description", "My Game! Built buy cocos2dx."));
params.insert(std::make_pair("link", "http://www.cocos2d-x.org"));
params.insert(std::make_pair("picture", "http://files.cocos2d-x.org/images/orgsite/logo.png"));

if (FacebookAgent::getInstance()->canPresentDialogWithParams(params)) 
{
     //this will execute if facebook app is installed on device
    FacebookAgent::getInstance()->dialog(params, [=](int ret ,std::string& msg)
                                         {
                                             CCLOG("%s", msg.c_str());
                                         });
}
else 
{
    //this will execute if facebook app is not installed in device
    FacebookAgent::getInstance()->share(params, [=](int ret ,std::string& msg)
                                        {
                                            CCLOG("%s", msg.c_str());
                                        });
}

Thank lazydevx,
You make my day.
But i want to share a screenshot of my game, can i do it when using Feed Dialog.

params.insert(std::make_pair("picture", "http://files.cocos2d-x.org/images/orgsite/logo.png"));

just can share a URL picture, how can i share a screenshot picture when user device didn’t install Facebook app.

@lazydevx sorry guys after a long while i see this post.the post title is Facebook plugin - get list of friends but mostly answer are related to share dialogue. i am using latest version of sdkbox and go through all functions of facebook plugin but i did not found solution of my problem.my problem is i am unable to get friend list i am setting up permission user_friends, see code below

FBAPIParam params;
sdkbox::PluginFacebook::api("/me/friendlists", "GET", params, "/me/friendlists");

there is no listener in facebook plugin who notify your friend list has been fetched. please give me what should i do ?

Thanks in advance.

to use “me/friendlists” you have to set permission “read_custom_friendlists”. It will give you id your friends. This permission need facebook review.

you can use “me/friends” with permission “user_friends”, it will give you only those friends which already installed your app. This permission doesn’t require facebook review.

thanks it works.