Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在Facebook上发布照片后,如何获取照片的url?_Android_Facebook_Url_Facebook Graph Api - Fatal编程技术网

Android 在Facebook上发布照片后,如何获取照片的url?

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 " +

我需要得到上传照片的网址。我发布了它并获得了post的id:

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我用“我/照片”发的