为什么我的动态链接无法在 Play 商店安装后继续存在?

Cam*_*ige 5 android firebase firebase-dynamic-links

我正在尝试设置动态链接,以便链接将用户深度链接到应用程序(如果他们已经安装了该应用程序)和游戏商店(如果没有安装)。我希望该链接能够在 Play 商店安装过程中保留下来,并与该链接一起发送到启动器活动。当应用程序已安装时,动态链接将起作用。但是,当应用程序未安装时,它会将用户发送到 Play 商店,但动态链接不会在安装过程中保留下来。我读过,当用户通过动态链接发送到游戏商店时,“打开”按钮应该更改为“继续”,但当我这样做时,它仍然显示“打开”。这是我在 AndroidManifest.xml 中的活动。

        <activity android:name=".share.DeepLinkActivity"
        android:theme="@style/AppTheme"
        >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <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="housebook.com"
                android:scheme="https"/>
            <data
                android:host="housebook.com"
                android:scheme="http"/>
        </intent-filter>
        <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"/>
            <data
                android:host="housebook.page.link"
                android:scheme="https"/>
            <data
                android:host="housebook.page.link"
                android:scheme="http"/>
        </intent-filter>

    </activity>
Run Code Online (Sandbox Code Playgroud)

这是我的 DeepLinkActivity

package chenige.chkchk.wairz.share

import android.app.AlertDialog
import android.content.Intent
import android.os.Bundle
import chenige.chkchk.wairz.BaseActivity
import chenige.chkchk.wairz.landing.LandingActivity
import chenige.chkchk.wairz.model.ShareDeepLink
import chenige.chkchk.wairz.sign_in.SignInActivity
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.dynamiclinks.FirebaseDynamicLinks

class DeepLinkActivity : BaseActivity() {

    companion object {
        const val SHARE_DEEP_LINK = "SHARE_DEEP_LINK"
    }
    var mAuth = FirebaseAuth.getInstance()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)


        if(intent.data != null){
            FirebaseDynamicLinks.getInstance().getDynamicLink(intent).addOnSuccessListener { pendingDynamicLinkData ->

                if(pendingDynamicLinkData != null) {

                    val houseId = pendingDynamicLinkData.link!!.getQueryParameter("House")
                    val shareId = pendingDynamicLinkData.link!!.getQueryParameter("Share")
                    goIntoAppWithShare(houseId!!, shareId!!)
                }else{
                    goIntoApp()
                }

            }.addOnFailureListener {failure ->
                showErrorRetrievingLink(failure.message!!)
            }

        }else{
            goIntoApp()
        }

    }


    fun goIntoAppWithShare(houseId: String, shareId: String){
        val intent : Intent
        if (mAuth.currentUser != null) {
            intent = Intent(this, LandingActivity::class.java)
        }else{
            intent = Intent(this, SignInActivity::class.java)
        }

        intent.putExtra(SHARE_DEEP_LINK, ShareDeepLink(houseId, shareId))
        intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
        startActivity(intent)
        finish()
    }

    fun goIntoApp(){

        val intent : Intent
        if (mAuth.currentUser != null) {
            intent = Intent(this, LandingActivity::class.java)
        }else{
            intent = Intent(this, SignInActivity::class.java)
        }
        startActivity(intent)
        finish()
    }


    fun showErrorRetrievingLink(error: String) {

        val dialog = AlertDialog.Builder(this).setTitle("Error Retrieving House").setMessage("HouseBook has had an issue retrieving the shared house.")
                .setPositiveButton("Ok.") { dialog, i ->
                    goIntoApp()
                }

        dialog.show()
    }
}
Run Code Online (Sandbox Code Playgroud)

我在 Firebase 控制台中添加了一个动态链接https://housebook.page.link 在此输入图像描述

我添加了 256 SHA 证书指纹。

我希望有效但无效的链接是https://housebook.page.link/nvfVf7N91D7dgBLV7

使用https://housebook.page.link/nvfVf7N91D7dgBLV7?d=1进行调试仅显示一个有关网络钓鱼的警告。我尝试添加配置来消除此警告,但没有帮助。有谁知道为什么该链接在安装过程中无法幸存?我已经为此苦苦挣扎了大约两周。