Facebook的应用程序邀请,邀请好友 [英] Facebook App Invite, Invite Friends

查看:598
本文介绍了Facebook的应用程序邀请,邀请好友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跳槽到Facebook 4.0,以实现AppInviteDialog为Android。我跟着这个 https://developers.facebook.com/docs/app-invites/android

I switched to facebook 4.0 in order to implement AppInviteDialog for Android. I followed this https://developers.facebook.com/docs/app-invites/android

出现的对话框中,我可以选择的朋友,邀请他们,我得到的的onSuccess()呼叫,但我的朋友没有得到邀请。 :(

The dialog appears, I can select friends, invite them, I get the onSuccess() call BUT my friends don't get the invitee. :(

我用下面applink网址 - https://fb.me/ **** 412097 ** ***

I have used the below applink URL - https://fb.me/****412097*****

没有previewImageURL虽然我看到了对话框上我的应用程序的形象。

No previewImageURL although I saw my apps image on the dialog.

code:

//Inside onCreate -

        callbackManager = CallbackManager.Factory.create();

        mInvititeDialog = new AppInviteDialog(this);
        mInvititeDialog.registerCallback(callbackManager,
                new FacebookCallback<AppInviteDialog.Result>() {

                    @Override
                    public void onSuccess(Result result) {
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this,
                                "Invitation Sent Successfully!");
                        finish();
                    }

                    @Override
                    public void onCancel() {
                        Log.d("Result", "Cancelled");
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this, "Cancelled");
                        finish();
                    }

                    @Override
                    public void onError(FacebookException exception) {
                        Log.d("Result", "Error " + exception.getMessage());
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this,
                                "Error while inviting friends");
                        finish();
                    }
                });


    if (AppInviteDialog.canShow()) {
            AppInviteContent content = new AppInviteContent.Builder()
                            .setApplinkUrl(appLinkUrl).build();

            AppInviteDialog.show(InviteFriendsActivity.this, content);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // TODO Auto-generated method stub
        super.onActivityResult(requestCode, resultCode, data);
        callbackManager.onActivityResult(requestCode, resultCode, data);

    }

任何帮助,或指导真是AP preciated。谢谢你。

Any help, or guidance is really appreciated. Thanks.

相似以下链接(即使他们是从IOS)没有帮助

$ C $下FB邀请工作不

的Facebook应用程序邀请问题

Facebook应用程序邀请没有收到

推荐答案

好了,原来一切都工作正常,毕竟。我的错误是在假设没有安装该应用程序,并没有授权应该产生一个推送通知的应用程序。

Ok, turns out everything was working fine after all. My mistake was in assuming not having the app installed, and not having the app authorized should generate a push notification.

创建一个新的测试用户,用在这里是当前未安装该应用程序的设备,并从来没有被授权的用户,应用程序后,

After creating a new test user, using a device where the app was not currently installed and the app NEVER having been authorized with the user.

因此​​,这里的关键是,如果应用程序被安装在目标设备上,即使用户没有授权该应用previously没有推送通知将生成。此外,看似,如果用户已经pviously授权该应用$ P $,即使除去它在某些时候,它也不会产生通知。

So the key here is that no push notification will be generated if the app is installed on the target device, even if the user has not authorized the app previously. Also, seemingly, if the user has authorized the app previously, even if it was removed it at some point, it also will not generate a notification.

所以,如果你想测试这一点,创建一个全新的测试用户,并在平台上的Facebook应用程序,你正在测试上登录,并确保应用程序未安装在设备上。

So if you want to test this, create an entirely new test user and log in on the Facebook app on the platform you are testing on, and make sure the app is not installed on the device.

我觉得还是应该生成一个通知,尽管应用程序被安装,因为多个用户可能会使用相同的设备,但是这是它似乎是现在。

I think it should still generate a notification despite app being installed, because multiple users might be using the same device, but that's how it seems to be right now.

我会离开这里在此情况下,任何人有在今后类似的问题。

I'll leave this here in case anyone has a similar problem in the future.

很长很精彩!

来源

这也实际上为我工作,但我不是很肯定,如果它涵盖了所有的场景,是一个完美的解决方案。张贴在这里的其他用户和建议(如有)。

It did actually work for me, however I am not very sure if it covers all the scenarios and is the perfect solution. Posting here for other users and suggestions if any.

这篇关于Facebook的应用程序邀请,邀请好友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆