I have two options to share a image on facebook.One to directly post the image on the users 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
s wall successfully.But i dont know how to share image on a facebook page.Any hep please?
Asked
Active
Viewed 229 times
-1

Selvam
- 1
- 3
-
try [this](https://developers.facebook.com/docs/graph-api/reference/v2.3/page/feed#publish) – calvinfly Jun 24 '15 at 08:36
-
Thanks @calvinfly I tried on that,now it`s working.Thanks a lot – Selvam Jun 26 '15 at 10:46
1 Answers
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();
}

Selvam
- 1
- 3