使用动态链接的Firebase邀请-使用引荐链接的启动活动无法启动

时间:2018-11-18 07:35:46

标签: android firebase firebase-dynamic-links firebase-invites

我正在尝试使用Firebase API动态生成动态链接,然后在whatsapp中发送引荐链接。单击链接后,其他用户已安装并打开了该应用程序,应将他重定向到ReferralWelcome页面,然后转到实际的Login页面进行注册。

对于FirebaseDynamicLinks.getInstance()。createDynamicLink()。setLink,我将uri设置为“ https://xyz.co/?invitedby=” + uid; //其中uid-登录的Firebase用户的用户ID。我的setDomainUriPrefix是“ https://xyz.page.link

在AndroidManifest文件中,我有使用-

声明的活动(在打开引用的应用程序-ReferralWelcome后将定向到该活动)
<activity android:name=".ReferralWelcomeActivity"
                  android:screenOrientation="portrait"
                  android:label="@string/app_name"
                  android:noHistory="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:host="xyz.co" android:scheme="https"/>
            </intent-filter>
        </activity>

尽管如此,当单击并打开Firebase URL时,默认情况下会打开应用程序“登录”页面(即启动器页面),然后触发FirebaseDynamicLinks.getInstance()。getDynamicLink(getIntent())并在其中

触发了ReferralWelcome活动的startActivity
Intent intent = new Intent(Intent.ACTION_VIEW);
                            intent.setPackage(getPackageName());
                            intent.setData(deepLink);

// deepLink = getLink()来自传递给onSuccess的PendingDynamicLinkData

startActivity一旦启动LoginActivity,应用就会因ActivityNotFoundexception而崩溃。 如果LoginActivity是我的应用程序的开始活动,那么MainActivity是我在其中生成Firebase动态URL并与用户共享的活动。单击后,他们将被下载并下载该应用程序(如果未安装),然后进入登录活动(默认情况下),在该活动中,检查将提取邀请信息并打开用户的ReferralWelcomeActivity页面。就事件顺序/编写的代码而言,有什么问题吗?请帮忙。

0 个答案:

没有答案
相关问题