发送邀请Facebook的朋友加入我的网站
我建立我已经使用 Facebook的SDK集成功能NEW一个Android应用程序
package.I've也succeded在我的应用程序来获取所有的名字我的Facebook 朋友
,其名称
和的ID
。进一步我想从我的应用程序的邀请发送给所有的Facebook好友加入website.Canü点我在正确的方向,因为我还没有发现对internet.Thank你什么
I have build an android application in which I've integrated faceboook using the facebook-sdk
package.I've also succeded to retrieve in my application the name of all my facebook friends
, their names
and their id's
.Further I want to send from my application an invitation to all facebook friends to join a website.Can u point me in the right direction cause I haven't found anything on the internet.Thank you
尝试使用下面的code,如果你按照我给你在你的另一个问题教程,将工作没有probs!
Try using the code below, if you follow the tutorials i gave you in your other question it will work no probs!
protected void postOfferToWall(String userID){
try {
if (isSession()) {
String response = mFacebook.request((userID == null) ? "me" : userID);
Bundle params = new Bundle();
params.putString("message", "message goes here");
params.putString("link", "http://mysite.com");
params.putString("caption", "Click the link");
params.putString("description", "description of link");
params.putString("name", "name of link");
params.putString("picture", "http://url.to.my.picture/pic.jpg");
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 {
// no logged in, so relogin
Log.d(TAG, "sessionNOTValid, relogin");
mFacebook.authorize(this, PERMS, new LoginDialogListener());
}
}catch(Exception e){
e.printStackTrace();
}
}