How to share Title and description from android to facebook using facebook sdk 4.1.2

后端 未结 1 1830
攒了一身酷
攒了一身酷 2021-01-25 19:09

I am using Facebook sdk 4.1.2 to share contents to Facebook . https://developers.facebook.com/docs/sharing/android This is the link i reffered for doing this task And was succes

相关标签:
1条回答
  • 2021-01-25 19:24
    shareDialog = new ShareDialog(ShareActivity.this);
                ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
                        .putString("og:type", "books.book")
                        .putString("og:title", "A Game of Thrones")
                        .putString("og:description","In the frozen wastes to the north of Winterfell, sinister and supernatural forces are mustering.")
                        .putString("books:isbn", "0-553-57340-3").build();
    
                ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
                        .setActionType("books.reads").putObject("book", object)
                        .build();
                ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
                .setPreviewPropertyName("book")
                .setAction(action)
                .build();
                shareDialog.show(content);
    
            }
    
    0 讨论(0)
提交回复
热议问题