【问题标题】:How to share image on a particular facebook fan page on android?如何在 android 上的特定 facebook 粉丝页面上分享图像?
【发布时间】:2015-06-24 08:12:42
【问题描述】:

我有两个选项可以在 facebook 上分享图片。一个可以成功地将图片直接发布到 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 users 墙上。但是我不知道如何在 facebook 页面上分享图片。请帮忙?

【问题讨论】:

  • 试试this
  • 谢谢@calvinfly 我试过了,现在可以了。非常感谢

标签: android facebook image facebook-graph-api android-sharing


【解决方案1】:
    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();
     }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多