0
我必須發佈消息給特定的朋友的牆。我嘗試過「我/喂」,但它顯示給所有我的朋友,但我需要爲特定的朋友發佈消息。發佈到特定的好友的Facebook牆
我必須發佈消息給特定的朋友的牆。我嘗試過「我/喂」,但它顯示給所有我的朋友,但我需要爲特定的朋友發佈消息。發佈到特定的好友的Facebook牆
你需要知道的朋友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();
}
}
工作太好了,謝謝:)肯尼如何 –
在圖形API使用批次要求張貼到多個朋友牆 – veerendra
什麼是mFacebook? – user1688181