I try fetch album datas from facebook and i use this method for fetch album cover photo. i get response like this;
{Response: responseCode: 200, graphObject: GraphObject{graphObjectClass=GraphObject, state={“FACEBOOK_NON_JSON_RESULT”:”����u0000u0010JFIFu0000u0001u0002u0000u0000u0001u0000u0001u0000u0000��u0000�Photoshop”}}, error: null, isFromCache:false}
What’s that’s mean ? How can i get image url or image ?
Code is here :
for(final FbAlbumItem f: albums){
Bundle params = new Bundle();
params.putString("type", "small");
new Request(
Session.getActiveSession(),
"/"+f.getAlbumId()+"/picture",
params,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
Log.i("SocialManager", "" + response);
JSONObject obj = response.getGraphObject().getInnerJSONObject();
try {
JSONObject o = obj.getJSONObject("albums").getJSONObject("data");
String url = o.getString("url");
f.setImageUrl(url);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
).executeAsync();
FbAlbumItem :
String albumId;
String albumName;
String albumCover;
String imageUrl;
3
Answers
Solved. I use my method with some change. Add this parameter
Thanks for inspiration.
U could have done like this.
Prerequisite –
user_photos
permission for non public albumsGet it with the
cover_photo
fieldDoc reference here