android - 应用程序链接在 Android 中无法正常工作

标签 android deep-linking android-app-links

我们需要一个应用程序链接。

我们在 manifest 中设置了 intent-filter 如下:

<intent-filter android:autoVerify="true">
    <data
        android:host="www.we.cards"
        android:pathPrefix="/wecards/"
        android:scheme="https" />

    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

</intent-filter>

相关 Activity 中有处理 Intent 的代码。 在android studio app link assistant中也验证如下:

enter image description here

它映射到正确的 Activity 如下:

enter image description here

该 Activity 还具有处理 Intent 的代码。

但是,在点击 URL 时,而不是直接打开应用程序 - 我们会看到一个对话框来选择一个选项,我们会在其中列出我们的应用程序。

我们期待直接的应用程序重定向,而不是这样的对话框。

enter image description here

如果您有任何解决方案,请尽可能详细说明。

最佳答案

由于 android:scheme="https" 在所有浏览器应用程序中使用,应用程序链接按预期工作,您可以在提供的应用程序列表中看到它们。要像您期望的那样实现重定向,您必须使用独特的方案,例如 android:scheme="cards" 所以链接应该看起来像 cards://www.we.cards/wecards/ 但如果这种情况 Not Acceptable ,您可以使用 Firebase Dynamic Link .这是一个强大的工具,可以重定向到应用程序或游戏市场

关于android - 应用程序链接在 Android 中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58729368/

相关文章:

android - 解密适用于 String.getBytes() 的 IV,但会失败 SecureRandom.generateSeed()

android - 如何从命令行在 Android SDK 中设置 “Force fetch using http://"

android - 创建自定义网格板(如棋盘游戏中所示)

android - 博览会和 native react : Redirect back to the running app after login from identity server in webview

ios - 我已经在我的服务器上上传了 apple-app-site-association,用于后端服务

android - 防止重定向触发应用/通用链接行为

android - 未知命令 : verify-app-links when using adb shell pm verify-app-links

android - 如何调整内容 div 的大小以覆盖 jQuery Mobile 中的整个内容区域

javascript - FancyBox/Popup 深度链接