0

我正在尝试使用 Android SDK 在我的 Facebook 墙上发布消息。我曾经试过这个,它成功了。它张贴了一个矩形框,左下角有一个图标,一个标题和一条消息。这是我的代码。

final  Bundle parameters = new Bundle();
                        parameters.putString("to", friendId);
                        parameters.putString("caption", "Little Cast Invitation");
                        parameters.putString("description", "Please View my video");
                        parameters.putString("message","Hello"); 
                        parameters.putString("icon", "http://www.veryicon.com/icon/png/Object/Points%20Of%20Interest/Theater%20Yellow%202.png");
                        parameters.putString("name","Invitation to View Video");
                        Utility.mAsyncRunner.request("me/feed", parameters,"POST", new myPostListener(), 1);

这只会在我的墙上发布一条消息“你好”。其他一切都被忽略了吗?这有什么帮助吗?

4

1 回答 1

0

试试这个:

私人脸书脸书;

public void postMessageOnWall(Activity activity, String message, String picture, String caption, String name) {
    if (facebook.isSessionValid()) {
        Bundle parameters = new Bundle();
        parameters.putString("message", message);
        parameters.putString("picture", picture);
        parameters.putString("caption", caption);
        parameters.putString("name", name);
        try {
            String response = facebook.request("me/feed", parameters, "POST");
            System.out.println(response);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
于 2012-09-06T15:05:18.890 回答