Facebook OpenGraph对话框出现2秒钟后消失

时间:2015-04-24 11:18:22

标签: android facebook facebook-graph-api facebook-android-sdk facebook-share

我的Facebook登录工作正常,我有一个按钮,在其点击内我有以下代码:

$object_file = 'gs://testing001/test/video/movie.ogg';
$object_url = CloudStorageTools::getImageServingUrl($object_file);    

但不幸的是,由于可怜的Facebok文档,我无法正常调试,我没有得到任何日志。对话框显示2秒钟,然后我可以按任何内容消失。这可能是什么原因?

不知何故,我设法做到了这一点:

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.read")
    .putObject("book", object)
    .build();

ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
    .setPreviewPropertyName("book")
    .setAction(action)
    .build();

ShareDialog.show(getActivity(), content);

1 个答案:

答案 0 :(得分:0)

您将操作类型设置为" books.read",但实际上它是" books.reads"。见https://developers.facebook.com/docs/reference/opengraph/action-type/books.reads/