Android 在Facebook上发布照片后,如何获取照片的url?
我需要得到上传照片的网址。我发布了它并获得了post的id:Android 在Facebook上发布照片后,如何获取照片的url?,android,facebook,url,facebook-graph-api,Android,Facebook,Url,Facebook Graph Api,我需要得到上传照片的网址。我发布了它并获得了post的id: JSONObject graphResponse = response.getGraphObject() .getInnerJSONObject(); String postId = null; try { postId = graphResponse.getString("id"); } catch (JSONException e) { Log.i("Facebook Error", "JSON error " +
JSONObject graphResponse = response.getGraphObject()
.getInnerJSONObject();
String postId = null;
try {
postId = graphResponse.getString("id");
}
catch (JSONException e) {
Log.i("Facebook Error", "JSON error " + e.getMessage());
}
现在我想获取这张照片的url。
如何获取此url?根据@Tomislav的链接,使用:
https://graph.facebook.com/10150146071831729?access_token=AAAAAAITEghMBAC041bexTcyhRKuLWt7MaXNTy3YydqD3mN6lvrmeZCbxiUQGcgBJ7v3rOrvrlzBuByzGjWZBLOhcafA0IuMXjN9tLlaQZDZD`
其中是您感兴趣的照片的ID,它将在返回的JSON对象的链接中返回URL
参考资料:我已经解决了这个问题
1.必要的权限:发布操作、用户照片、读取流
2.照片上传后获取post_id:
postId = graphResponse.getString("post_id");
3.获取帖子:
Request mRequest = new Request(session, "me/feed", null,
HttpMethod.GET, callback);
按id查找帖子并获取照片的url:
String id = json_obj.getString("id");
if (id.equals(postId)) {
String url = json_obj.getString("picture");
}
当你说你“发布了”的时候,你到底是什么意思?你是怎么发的?@Dr.Dredel我用“我/照片”发的