发布到特定的朋友的Facebook墙上 [英] Post to specific friend's facebook wall
本文介绍了发布到特定的朋友的Facebook墙上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要发布一条消息到一个特定的朋友的墙上。我曾试图与我/饲料,但它会显示我所有的朋友,但我需要发布一个消息,为特定的朋友。
I have to post a message to a specific friend's wall. I have tried with "me/feed" but it is displayed for all my friends, but I need to post a message for a specific friend.
推荐答案
您需要知道的朋友的ID,你可以看到我的方法下面这样做:
You need to know the friends id, you can see my method for doing it below:
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();
}
}
这篇关于发布到特定的朋友的Facebook墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文