I switched to Facebook 4.0 in order to implement AppInviteDialog for Android. I followed this reference.
The dialog appears, I can select friends, invite them, I get
I am using the following code and is working fine... but After inviting friends (if you've shared android application then invitee have to check on his/her mobile application..) the invitation is not visible through browsers
private CallbackManager sCallbackManager;
public void openDialogInvite(final Activity activity) {
String AppURl = "https://fb.me/421570...5709"; //Generated from //fb developers
String previewImageUrl = "http://someurl/13_dp.png";
sCallbackManager = CallbackManager.Factory.create();
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(AppURl).setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
appInviteDialog.registerCallback(sCallbackManager,
new FacebookCallback() {
@Override
public void onSuccess(AppInviteDialog.Result result) {
Log.d("Invitation", "Invitation Sent Successfully");
finish();
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException e) {
Log.d("Invitation", "Error Occured");
}
});
appInviteDialog.show(content);
}
}