我想采取Facebook帖子图片的Url。我使用 logInWithPublishPermissions 在Facebook上成功发布了照片,但我想要回调邮件图片的链接或网址....
SharePhoto photo = new SharePhoto.Builder()
.setBitmap(bitmap)
.setCaption("VodaFone Rakshavandhan!")
.build();
SharePhotoContent content = new SharePhotoContent.Builder()
.addPhoto(photo)
.build();
ShareDialog shareDialog = new ShareDialog(FacebookShareActivity.this);
shareDialog.show(content, ShareDialog.Mode.AUTOMATIC);
shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Log.e("@@@result", String.valueOf(result));
/* "/"+mFBID+"_"+postid+"?fields=link,message",*/
String postid=result.getPostId().toString();
mUrlFb="https://www.facebook.com/photo.php?fbid="+postid;
Log.e("@@@mUrlFb",mUrlFb);
GraphRequest request = new GraphRequest(
accessToken,
"/"+mFBID+"_"+postid,
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.e("@@response", String.valueOf(response));
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,link,message");
request.setParameters(parameters);
request.executeAsync();
/* new GraphRequest(
AccessToken.getCurrentAccessToken(),
result.getPostId(),
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.e("@@response", String.valueOf(response));
}
}
).executeAsync();*/
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException e) {
e.printStackTrace();
}
});
我从此图表请求获得响应
{Response: responseCode: 200, graphObject:
{"id":"104752556880730_105851436770842"}, error: null}
任何帮助表示赞赏。
答案 0 :(得分:0)
特别感谢@CBroe
仅添加参数**permalink_url**
parameters.putString("fields", "id,link,message,permalink_url");