在安卓手机上如何发布 Facebook 动态墙

4

我正在尝试从我的应用程序内部集成发布到用户的墙上。我尝试了这段代码,但是得到了如下的响应:

   public void postMessageOnWall(String msg) {
        Log.d("Tests", "Testing graph API wall post");
         try {
                String response = mFacebook.request("feed");
                Bundle parameters = new Bundle();
                parameters.putString("message", "dfsagfsadfsafsadf by thamil");
                parameters.putString("description", "test test test");

                response = mFacebook.request("feed", parameters);
                Log.d("Tests", "got response: " + response);
                if (response == null || response.equals("") || 
                        response.equals("false")) {
                   Log.v("Error", "Blank response");
                }
         } catch(Exception e) {
             e.printStackTrace();
         }

            }




' {"error":{"message":"No node specified","type":"Exception"}}'
2个回答

1

您需要指定要发布的源,例如:

response = mFacebook.request("me/feed", parameters, "POST");

这将发布到您自己的动态。

Facebook在GitHub上提供了一些有用的示例,例如this one(向下滚动到testAuthenticatedApi()方法,以获取您要尝试完成的示例)。



网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接