我有两个选项可以在facebook上分享图片。一个人可以直接在用户s wall and the other to share image on a facebook fan page that i have created recently by the users. I done share image on user
的墙上发布图片。但我不知道如何在脸书页面上分享图片。有什么问题吗?< / p>
答案 0 :(得分:0)
private void shareToPage() {
//Getting image intent as bytearray
byte[] byteArray = getIntent().getByteArrayExtra("image");
Bundle bundle = new Bundle();
bundle.putByteArray("object_attachment", byteArray);
bundle.putString("message", "some message here");
GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(),
"/" + pageID + "/photos",
bundle,
HttpMethod.POST,
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse graphResponse) {
Log.d("Page response==>",graphResponse.toString());
Toast.makeText(SharePageActivity.this, "Photo uploaded successfully", Toast.LENGTH_LONG).show();
});
graphRequest.executeAsync();
}