How to send an invitation to facebook friends through my App on Android..
Here is how you can do it:
public void inviteFriends(Activity activity, ArrayList<FriendInfo> friendsIds){
// Safe programming
if(friendsIds == null || friendsIds.size() == 0)
return;
Bundle parameters = new Bundle();
// Get the friend ids
String friendsIdsInFormat = "";
for(int i=0; i<friendsIds.size()-1; i++){
friendsIdsInFormat = friendsIdsInFormat + friendsIds.get(i) + ", ";
}
friendsIdsInFormat = friendsIdsInFormat + friendsIds.get(friendsIds.size()-1).getId();
parameters.putString("to", friendsIdsInFormat);
parameters.putString( "message", "Use my app!");
// Show dialog for invitation
mFacebook.dialog(activity, "apprequests", parameters, new Facebook.DialogListener() {
@Override
public void onComplete(Bundle values) {
// TODO Auto-generated method stub
}
@Override
public void onFacebookError(FacebookError e) {
// TODO Auto-generated method stub
}
@Override
public void onError(DialogError e) {
// TODO Auto-generated method stub
}
@Override
public void onCancel() {
// TODO Auto-generated method stub
}
});
}
Facebook dialog reference