Here's how you can do it:
public void inviteFriends(Activity activity, ArrayList<FriendInfo> friendsIds){
if(friendsIds == null || friendsIds.size() == 0)
return;
Bundle parameters = new Bundle();
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!");
mFacebook.dialog(activity, "apprequests", parameters, new Facebook.DialogListener() {
@Override
public void onComplete(Bundle values) {
}
@Override
public void onFacebookError(FacebookError e) {
}
@Override
public void onError(DialogError e) {
}
@Override
public void onCancel() {
}
});
}
dialogue link
source
share