如何使用Facebook的朋友ID发布的图像和消息combinely朋友墙 [英] How to post image and message combinely to friends wall using friends facebook id
问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/13646861/how-to-post-on-multiple-friends-wall-using-their-facebook-ids\">How张贴在多个好友墙上使用他们的Facebook的ID
我想用朋友的Facebook ID发布(图像+消息)或有时消息仅给好友留言。
I want to post (image+message)or sometimes message only to friends wall by using friends facebook id.
是否有可能通过使用Facebook的SDK或图形API来做到这一点?
Is it possible to do this by using facebook sdk or graph api?
实际需要我是得了,我有我的一些朋友的Facebook的ID,我想通过张贴在他们的墙上自己的Facebook的ID。
The actual requirement I got is, I have some of my friends facebook id's and I want to post on their wall by using their facebook ids.
我怎么能满足这一要求?
How can I fulfill this requirement?
任何想法。
在此先感谢
推荐答案
图片报的变量在墙上,它从一个网址张贴事先知情同意,但你可以把它改成
"picture" variable to a wall, it posts a pic from a URL but you can change it to
protected void postPicToWall(String userID, String msg, String caption, String picURL){
try {
if (isSession()) {
String response = mFacebook.request((userID == null) ? "me" : userID);
Bundle params = new Bundle();
params.putString("message", msg);
params.putString("caption", caption);
params.putString("picture", picURL);
response = mFacebook.request(((userID == null) ? "me" : userID) + "/feed", params, "POST");
Log.d("Tests",response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} else {
// for relogin
Log.d(TAG, "sessionNOTValid, relogin");
mFacebook.authorize(this, PERMS, new LoginDialogListener());
}
}catch(Exception e){
e.printStackTrace();
}
}
这篇关于如何使用Facebook的朋友ID发布的图像和消息combinely朋友墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!