我正在尝试将Firebase动态链接集成到Android应用程序中,但是问题是,即使已安装该应用程序,该动态链接仍会带我进入游戏商店页面以从Play商店下载该应用程序。
我发送了带有动态链接的电子邮件。然后在Android智能手机上,我打开电子邮件并单击动态链接,它将始终播放商店。
是否有人面对过同样的问题,并且有解决方案?

当我在https://firebase.google.com/docs/app-indexing/android/test进行测试时
动态链接可以很好地连接到应用程序。因为该应用程序已安装。

我在应用程序中添加了SHA-1,SHA-256密钥。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.chillingchat.android">

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@drawable/adv"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    >
    <activity
        android:name="io.chillingchat.android.view.MainActivity"
        android:label="@string/app_name">

    </activity>

    <activity
        android:name="io.chillingchat.android.view.AuthActivity">

        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <data
                android:host="chillingchat.io"
                android:scheme="https"/>
            <data
                android:host="chillingchat.io"
                android:scheme="http"/>
        </intent-filter>
    </activity>


</application>




actionCodeSettings = ActionCodeSettings.newBuilder()
            // URL you want to redirect back to. The domain (www.example.com)
            // URL must be whitelisted in the Firebase Console.
            .setUrl("https://chillingchat.page.link/in")
            // This must be true
            .setHandleCodeInApp(true)
            .setAndroidPackageName(
                    "io.chillingchat.android",
                    true, /* installIfNotAvailable */
                    "16"    /* minimumVersion */)
            .build();

最佳答案

最后,我解决了这个可怕的问题。

在actionCodeSetting中,

.setAndroidPackageName(
                "io.chillingchat.android",
                true, /* installIfNotAvailable */
                "16"    /* minimumVersion */)


改成

.setAndroidPackageName(
                "io.chillingchat.android",
                false, /* installIfNotAvailable */
                "16"    /* minimumVersion */)


但是我不知道为什么将true改为false * installIfNotAvailable *选项可以正常工作。

09-16 06:59