如何使用facebook android SDK在开放图形故事中发布自定义对象?

时间:2015-08-28 20:30:19

标签: android facebook-graph-api facebook-opengraph

使用最新的Facebook SDK更新,我看到ShareOpenGraphAction和ShareOpenGraphObject类以及ShareDialog和ShareAPI。 ShareOpenGraphObject具有在对象内部设置属性的方法,如下所示:

ShareOpenGraphObject object = new ShareOpenGraphObject.Builder()
    .putString("og:type", "fitness.course")
    .putString("og:title", "Sample Course")
    .putString("og:description", "This is a sample course.")
    .putInt("fitness:duration:value", 100)
    .putString("fitness:duration:units", "s")
    .putInt("fitness:distance:value", 12)
    .putString("fitness:distance:units", "km")
    .putInt("fitness:speed:value", 5)
    .putString("fitness:speed:units", "m/s")
    .build();
ShareOpenGraphAction action = new ShareOpenGraphAction.Builder()
    .setActionType("fitness.runs")
    .putObject("fitness:course", object)
    .build();
ShareOpenGraphContent content = new ShareOpenGraphContent.Builder()
    .setPreviewPropertyName("fitness:course")
    .setAction(action)
    .build();

如何使用此API共享自托管对象(使用Open Graph元标记在自己的Web服务器上创建和托管的自定义对象)?

请指教。

0 个答案:

没有答案