因为 FB,我把这个简单的问题搞复杂了。我尝试使用 facebook sdk 从 android 分享链接和图像。 以前有没有人玩过 ShareOpenGraphObject、ShareOpenGraphAction 和 ShareOpenGraphContent,facebook 文档很糟糕,根本没有示例。我正在等待示例。
谢谢
最佳答案
然后让我们发布一些代码:
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)
.putPhoto("image", photo)
.build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
.setPreviewPropertyName("book")
.setAction(action)
.build();
shareDialog.show(this, content);
我的想法是我不想使用一本书,我只想分享一张图片、一个链接和一条消息……我该怎么做? facebook sdk 很烂
关于android - 在 Facebook 上分享链接和图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31962286/