sdkbox::FBAPIParam params;
sdkbox::PluginFacebook::api("/me/picture", "GET", params, "/me/picture");
How can i get the picture from params to set it as texture for a Sprite?
Thank you!
sdkbox::FBAPIParam params;
sdkbox::PluginFacebook::api("/me/picture", "GET", params, "/me/picture");
How can i get the picture from params to set it as texture for a Sprite?
Thank you!
You can get the return json data by implementing onAPI callback
1.Implement onAPI callback of SDKBOX facebook plugin
void onAPI(const std::string& key, const std::string& jsonData);
2.In onAPI function, the parameter jsonData is the return json data from facebook server.
You can decode the json data to get the user avatar url.
Once you get the url of FB user’s avatar, just download it and save it.
Use the downloaded file to create a sprite.
the return jsonData is like this:
{
“data”: {
“is_silhouette”: false,
“url”: “https://scontent.xx.fbcdn.net/hprofile-xfp1/v/t1.0-1/p50x50/10678815_357001444451142_642855172939272173_n.jpg?oh=4e86ce22510337e3c030e77e80cf3368&oe=56AA8347”
}
}