Facebook Open Graph故事api v4.0

时间:2015-05-28 11:35:24

标签: android facebook facebook-graph-api

我正在开发一个Android应用程序并已将所有内容连接到Facebook并成功共享一个对话框并喜欢一个页面。现在我想使用开放图形api发布信息,因为我想以我自己的格式发布所有内容,图像,标题,坐标和小描述。 我已经创建了自定义开放图形storie但我无法设法使这项工作。 共享对话框立即打开和关闭

命名空间是roteiroobidos

Actiontype is Share

对象类型为Interesting_place

    ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
            .putString("og:type", "obidosroteiro.share")
            .build();
    ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
            .setActionType("obidosroteiro.share") //If i try to change any of these "share" the share dialog would not even open
            .putObject("obidosroteiro:share", object)
            .build();
    ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
            .setPreviewPropertyName("obidosroteiro:share")
            .setAction(action)
            .build();

由于

1 个答案:

答案 0 :(得分:0)

您必须使用以下方式更改调用对象/操作的方式:而不是。 此外,setPreviewPropertyName()应包含对象的名称,在本例中为share。

更改为:

ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
            .putString("og:type", "obidosroteiro:share")
            .build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
            .setActionType("obidosroteiro:share") //If i try to change any of these "share" the share dialog would not even open
            .putObject("obidosroteiro:share", object)
            .build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
            .setPreviewPropertyName("share")
            .setAction(action)
            .build();