【发布时间】:2011-06-25 18:34:50
【问题描述】:
我必须在特定朋友的墙上发布消息。我已经尝试过使用“me/feed”,但它会显示给我所有的朋友,但我需要为特定的朋友发布消息。
【问题讨论】:
标签: android facebook-graph-api
我必须在特定朋友的墙上发布消息。我已经尝试过使用“me/feed”,但它会显示给我所有的朋友,但我需要为特定的朋友发布消息。
【问题讨论】:
标签: android facebook-graph-api
你需要知道朋友的id,你可以看看我的方法如下:
public void postOnFriendsWall(String msg, String toID, String description) {
try {
if (isSession()) {
String response = mFacebook.request(toID);
Bundle parameters = new Bundle();
parameters.putString("message", msg);
parameters.putString("description", description);
response = mFacebook.request(toID+"/feed", parameters, "POST");
Log.d("FACEBOOK RESPONSE",response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} else {
// no logged in, so relogin
Log.d(TAG, "sessionNOTValid, relogin");
mFacebook.authorize(this, PERMS, new LoginDialogListener());
}
} catch(Exception e) {
e.printStackTrace();
}
}
【讨论】: