[英]Android facebook SDK post to walll
我正在嘗試使用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);
這只會在我的牆上張貼一條消息“ Hello”。 其他一切都被忽略了嗎? 有什么幫助嗎?
嘗試這個:
私人Facebook facebook;
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();
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.