"Dialog failed with unknown" 错误响应。 Facebook 应用程序邀请,在切换 fb 帐户时

"Dialog failed with unknown" error response . Facebook app invite, on switch of fb account

我在 Android facebook 应用程序邀请中遇到错误。一切正常。我从 Facebook 切换帐户,现在出现此错误。

if(AppInviteDialog.canShow()) {
                AppInviteContent content = new AppInviteContent.Builder()
                        .setApplinkUrl(VPPreferences.getString(VPPreferencesKeys.INVITE_SCREEN_URL_FOR_FB, ""))
                        .setPreviewImageUrl(getString(R.string.invite_fbimage_url))
                        .build();


                AppInviteDialog appInviteDialog = new AppInviteDialog(this);
                 sCallbackManager = CallbackManager.Factory.create();

                appInviteDialog.registerCallback(sCallbackManager, new FacebookCallback<AppInviteDialog.Result>() {
                    @Override
                    public void onSuccess(AppInviteDialog.Result result) {
                        ToastNotificationUtil.showMessageToast(InviteSelectorScreen.this, getString(R.string.invite_succ));
                    }

                    @Override
                    public void onCancel() {
                        ToastNotificationUtil.showMessageToast(InviteSelectorScreen.this, "Invite canceled");

                    }

                    @Override
                    public void onError(FacebookException e) {
                        ToastNotificationUtil.showMessageToast(InviteSelectorScreen.this, "Invite failed ");

                    }
                });

                appInviteDialog.show(content);
            }

引用 Facebook Developers 他们的政策有重大变化。

As of November 7, 2017, link customization is available however the link must be owned by the posting page and a page access token is required.

To verify ownership, check the ownership_permissions{can_customize_link_posts} field on the URL node. You must call this endpoint before posting new links.

Without this step, custom link page posts will not work for un-scraped links. See our Link Ownership Guide for more information.

For versions 2.10 and lower, picture, name, thumbnail, and description are deprecated. caption is deprecated for all versions.

请转到给定的 link 并更改检查 URL 节点上的 ownership_permissions{can_customize_link_posts} 字段。

希望对您有所帮助

我遇到了同样的问题 Hamza,我发现的是:

作为最新发布的 Facebook SDK 版本 4.28.0 - 2017 年 11 月 7 日,App Invites 已弃用。 https://developers.facebook.com/docs/app-invites/android/

With the release of the Facebook SDK version 4.28.0, App Invites is deprecated. It will be supported until February 5, 2018.

我认为解决方案是使用另一种方式让您的用户与朋友分享您的应用程序,例如 firebase dynamic links

希望对您有所帮助