hamza khan
hamza khan

Reputation: 151

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

I am having an error in Android facebook app invite. Everything was working fine. I switched the account from Facebook and now I am getting this error.

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);
            }

Upvotes: 4

Views: 433

Answers (2)

leo7r
leo7r

Reputation: 10588

I had the same issue Hamza, what I found is this:

As the latest release of Facebook SDK version 4.28.0 - November 7, 2017, App Invites is deprecated. 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.

I think the solution is to use another way to allow your users share your app with its friends like firebase dynamic links.

Hope it helps

Upvotes: 1

nimi0112
nimi0112

Reputation: 2133

Quoting from Facebook Developers there is a major change in their policy.

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.

Please go to the given link and change check the ownership_permissions{can_customize_link_posts} field on the URL node.

Hope this helps

Upvotes: 2

Related Questions