Get facebook username and save locally

I am using facebook in my game with SDKBox on Android and i cant seem to figure out how to save the user name once i get it using this:

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

void FBConnection::onAPI(const std::string& tag, const std::string& jsonData){
CCLOG("##FB >>onAPI: tag -> %s, json -> %s", tag.c_str(), jsonData.c_str());

playerName = jsonData.c_str();
MessageBox(playerName.c_str(), "Name");
}

this will display it to me in a message box with the id… how do i get just the username and save it so i can display it in the game?

Hey @Dobby90

before it was me/friends, but not it would also need you to get user_friends permission also to access the username.

please add this permission and use me/friends to get the username.
try that if it works.

is me/friends not for getting my friends list? i can get the names back(as a json string) it just is there a specific to seperate the json string to just pull out the username and not the id?

i have the user_friends permission set already.

I never tried that,
could you please PM me the json string, I would see how to extract names from it, shouldn’t be difficult I guess.