Android | Firebase 邀请结果代码正常,但邀请未发送

Android | Firebase invite result code is OK but invite NOT sent

我正在 Android 应用程序(食谱应用程序的索引)中实施 firebase 动态 links,起初它是基本的并且没有任何问题:

viewHolder.mShareBtn.setOnClickListener(view -> {    
            Intent intent = new AppInviteInvitation.IntentBuilder(mContext.getResources().getString(R.string.invitation_title))
                    .setMessage(mContext.getResources().getString(R.string.invitation_message))
                    .build();

            ((AppCompatActivity) mContext).startActivityForResult(intent, 4);
        });

但是我试图通过在食谱中添加深度 link 让它们变得更聪明:

viewHolder.mShareBtn.setOnClickListener(view -> {
            Uri deepLink = Uri.parse(mContext.getResources().getString(R.string.invitation_uri));
            Uri deepLinkPlus = Uri.withAppendedPath(deepLink, recipeKey);

            Intent intent = new AppInviteInvitation.IntentBuilder(mContext.getResources().getString(R.string.invitation_title))
                    .setMessage(mContext.getResources().getString(R.string.invitation_message))
                    .setDeepLink(deepLinkPlus)
                    .build();

            ((AppCompatActivity) mContext).startActivityForResult(intent, 4);
        });

代码更改后,结果代码仍然正常,我收到了已发送的祝酒词,但目标收件人没有收到,也没有出现在消息应用程序中。 我试图恢复到我的第一个实现,它不再起作用了。

这似乎已经记录在案,但没有答案Duplicate 1 and Duplicate 2

欢迎大家帮忙,谢谢观看!

这里是接收activity:

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(AppInvite.API)
            .enableAutoManage(this, this)
            .build();
    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false)
            .setResultCallback(
                    result -> {
                        if (result.getStatus().isSuccess()) {
                            //Get intent information
                            Intent intent = result.getInvitationIntent();
                            Uri deepLink = Uri.parse(AppInviteReferral.getDeepLink(intent));
                            //
                            Intent mIntent = new Intent(getApplicationContext(), RecipeDetailActivity.class);
                            mIntent.putExtra("recipe_key", deepLink.getLastPathSegment());
                            startActivity(mIntent);
                        }
                    }
            );

EDIT - After invalidating caches and restarting the project + clean and rebuild, I can get the email invites to work, SMS still not working. Is it failing silently? The result code is -1

解决方案是在 SHA1 之上添加 SHA256。