【问题标题】:Android | Firebase invite result code is OK but invite NOT sent安卓 | Firebase 邀请结果代码正常,但未发送邀请
【发布时间】:2017-02-28 18:53:30
【问题描述】:

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

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

但是我试图通过在食谱中添加深层链接来让它们更聪明:

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

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

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

欢迎所有帮助,感谢您的关注!

这是接收活动:

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

编辑 - 使缓存无效并重新启动项目 + 清理后 和重建,我可以收到电子邮件邀请工作,短信仍然没有 在职的。是默默地失败了吗?结果代码为-1

【问题讨论】:

  • 你解决了吗?我遇到了类似的问题...结果还可以,但其他人没有收到任何邀请。
  • 还没有,我无法让它持续发送消息和电子邮件。这是一个或另一个,但永远不会两者兼而有之,本周我将再次查看来自谷歌的 Firebase Invite 示例,我会在修复错误时通知您
  • 添加 sha256 和 sha1

标签: android firebase google-api-client firebase-dynamic-links firebase-invites


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-12
    • 2012-12-02
    • 1970-01-01
    相关资源
    最近更新 更多