如何在Facebook自定义开放图形故事中包含用户消息?

时间:2013-05-07 07:15:00

标签: android facebook opengraph

我想发布一个包含来自Android应用的用户消息的开放图形故事。 开放图形故事出现在用户新闻和活动日志中。 但是,用户消息不可见。我究竟做错了什么?

该应用程序被定义为游戏应用程序。
该应用具有publish_actions权限。
用户是facebook测试用户。
我已经定义了一个自定义操作“won”,启用了“user messages”和“explicit shared”。
我已经定义了相应的自定义对象“medal”。
我有以下代码来发布故事:

Bundle params = new Bundle();
params.putString("medal", "<url to medal html>");
params.putString("message", "test message");
params.putString("fb:explicitly_shared", "true");

Request postMedalRequest = new Request(
    Session.getActiveSession(),
    "me/twistwordcommunity:won",
    params,
    HttpMethod.POST,
    new Request.Callback() {
        @Override
        public void onCompleted(Response response) {
            FacebookRequestError error = response.getError();
            if (error != null) {
                Log.e("TWTEST-TAG", "Posting failed: " + error.getErrorMessage());
            } else {
                Log.i("TWTEST-TAG", "Posted successfully");
            }
        }
    });
Request.executeBatchAsync(postMedalRequest);

最后我为奖牌对象提供了以下html(使用开放图调试器验证):

<html>
    <head>
        <meta property="og:type" content="twistwordcommunity:medal"/>
        <meta property="og:title" content="Bonze level!"/>
        <meta property="og:description" content="Won bronze in TwistWord."/>
        <meta property="og:url" content="<url to this medal html>"/>
        <meta property="og:image" content="<url to image>"/>
        <meta property="fb:app_id" content="523030476477949"/>
    </head>
    <body>
        <p>New Medal! - Bronze!</p>
        <img src="<url to image>" />
    </body>
</html>

0 个答案:

没有答案