Hey my friends i have a problem in the callback of the AppInviteDialog its not working i try many thing but without a result please help me :
public void openDialogInvite(Activity activity)
{
String appLinkUrl, previewImageUrl;
appLinkUrl = "url";
previewImageUrl = "img";
if (AppInviteDialog.canShow())
{
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
CallbackManager sCallbackManager = CallbackManager.Factory.create();
AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
appInviteDialog.registerCallback(sCallbackManager, new FacebookCallback<AppInviteDialog.Result>()
{
@Override
public void onSuccess(AppInviteDialog.Result result) {
Toast.makeText(getApplicationContext(),"Success",Toast.LENGTH_LONG).show();
}
@Override
public void onCancel() {
Toast.makeText(getApplicationContext(),"Success",Toast.LENGTH_LONG).show();
}
@Override
public void onError(FacebookException error) {
Toast.makeText(getApplicationContext(),"Success",Toast.LENGTH_LONG).show();
}
});
appInviteDialog.show(content);
}
}
enter code here
Did you invoked the
CallbackManager
into theonActivityResult
method?