我需要使用图表API从Facebook帐户上传用户和标记照片。
我尝试了以下代码,但它没有给我任何信息。
GraphRequest request = GraphRequest.newMeRequest(
token,
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
// Insert your code here
Log.e("Hi "," "+response.getJSONObject().toString());
}
});
GraphRequest req = GraphRequest.newGraphPathRequest(token, "me/photos", callback);
Bundle parameters = new Bundle();
parameters.putString("fields", "id, name");
req.setParameters(parameters);
req.executeAsync();
我已经给了facbook以下的许可。
loginButton.setReadPermissions(Arrays.asList("public_profile","user_photos"));
由于
答案 0 :(得分:0)
使用此API
json.FB_URL+json.PAGE_ID+"?fields=albums.limit(30)%7Bname%2Cid%2Cdescription%2Cpicture%7D&access_token="+json.ACCESS_TOKEN