Android | Firebase邀请结果代码正常,但未发送邀请 [英] Android | Firebase invite result code is OK but invite NOT sent

查看:92
本文介绍了Android | Firebase邀请结果代码正常,但未发送邀请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Android应用程序(食谱应用程序的索引)中实现firebase动态链接,起初它是基本的并且可以正常工作:

I am implementing firebase dynamic links in an Android application (an index of recipes app), at first it was basic and worked without any issue:

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

但是,我尝试通过向食谱添加深层链接来使它们更智能:

However I tried to make them smarter by adding a deep link to the recipe:

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

更改代码后,结果代码仍然可以,并且我收到发送的吐司,但是预期的接收者未收到它,也没有出现在消息应用程序中. 我试图恢复到我的第一个实现,但现在无法正常工作了.

After the code change, the result code is still ok and I get the toast as sent but it is not received by the intended recipient nor does it appear in the message app. I tried to revert to my first implementation, it doesn't work anymore.

这似乎已经被记录在案,但没有答案.重复2

This seems to be already documented but there are no answers Duplicate 1 and Duplicate 2

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

All help welcomed, Thanks for taking a look!

这是接收活动:

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

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.

The solution was to add the SHA256 on top of SHA1.

这篇关于Android | Firebase邀请结果代码正常,但未发送邀请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆