简体   繁体   中英

Android Facebook invite only shown in “App Invites” section

I implemented the Facebook App Invites feature into my app. Sending and receiving works fine in my app, but the Facebook user that received the invite on his Android app doesn't receive neither push notification or general notification as specified here . It only shows up in the App Invites section. Does anyone know what can I do in order to show a Facebook notification?

Facebook SDK 4.20

Invite sending

private void initFbInvite(final CallbackManager callbackManager, final View inviteButton){
    Map<AppLinksManager.QueriesKeys, String> queries = new HashMap<>();
    queries.put(AppLinksManager.QueriesKeys.SENDER, UserManager.getInstance().getUser().getId());
    final Uri appLink = AppLinksManager.generateAppLink(AppLinksManager.Endpoint.FB_INVITE, queries);

    StorageReference previewImageUrlRef = mController.getStorageReference().child("applink-images/fb-invite.png");
    previewImageUrlRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
        @Override
        public void onSuccess(Uri uri) {

            final AppInviteContent inviteContent = new AppInviteContent.Builder()
                    .setApplinkUrl(appLink.toString())
                    .setPreviewImageUrl(uri.toString())
                    .build();

            final AppInviteDialog appInviteDialog = new AppInviteDialog(ExploreFragment.this);
            appInviteDialog.registerCallback(callbackManager, new FacebookCallback<AppInviteDialog.Result>() {
                @Override
                public void onSuccess(AppInviteDialog.Result result) {
                    Log.d(TAG, "FB invitation send successfully");
                }

                @Override
                public void onCancel() {
                    Log.e(TAG, "FB invitation cancelled");
                }

                @Override
                public void onError(FacebookException error) {
                    Log.e(TAG, "FB invitation error");
                }
            });

            inviteButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    appInviteDialog.show(inviteContent);
                }
            });
        }
    });
}

Custom App Link url used for this AppInviteContent

https://stellarscepter.com/clecs/fb-invite?sender=PsF6qaJPLKVnOjxr2Ufzs5cSVTZ2

index.html (stored in clecs/fb-invite folder on the server) for App Link metadata

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!-- Facebook App Link meta -->
    <meta property="al:android:url" content="clecs://fb-invite" />
    <meta property="al:android:app_name" content="Clecs" />
    <meta property="al:android:package" content="com.stellarscepter.clecs" />
    <meta property="al:android:class" content="com.stellarscepter.clecs.activity.LoginActivity" />
    <meta property="al:web:should_fallback" content="false" />

    <title>Stellarscepter</title>
  </head>
  <body>
  </body>
</html>

EDIT 1:

I tried with either test and real Facebook user, that has already received an invite and not received any one. I also tried with users that have autorized and not autorized via Facebook. In every combination no Facebook notification shown.

发现这是此处报告的一个Facebook SDK错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM