My function is not working it shows com.facebook.share.model.AppInviteContent
is deprecated in the tool tip :
(AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.build();
AppInviteDialog appInviteDialog = new AppInviteDialog(MainActivity.this);
CallbackManager sCallbackManager = CallbackManager.Factory.create();
appInviteDialog.registerCallback(sCallbackManager,
new FacebookCallback<AppInviteDialog.Result>() {
@Override
public void onSuccess(AppInviteDialog.Result result) {
Log.d("Invitation", "Invitation Sent Successfully");
Toast.makeText(getApplicationContext(), "Invitation Sent Succseesfully", Toast.LENGTH_LONG).show();
}
@Override
public void onCancel() {
Log.d("Invitation", "Invitation Cancel Successfully");
}
@Override
public void onError(FacebookException e) {
Log.d("Invitation", "Error Occured");
}
});
Can anyone help me with this? Or is there any other way around to achieve this?