我正在使用facebook从我的应用程序中实现邀请朋友。所有工作正常但当我邀请朋友然后推送通知未显示在我的朋友通知中。但通知由app成功发送。
如何解决这个问题。
public class Trail extends Activity {
private CallbackManager sCallbackManager;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_trail);
openDialogInvite(this);
}
public void openDialogInvite(final Activity activity) {
String AppURl = "https://fb.me/Id number...."; //Generated from //fb developers
String previewImageUrl = "";
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<AppInviteDialog.Result>() {
@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);
}
}
}