【问题标题】:App linking is not working as expected in Android应用程序链接在 Android 中无法按预期工作
【发布时间】:2020-03-02 21:23:05
【问题描述】:

我们想要我们的应用程序的应用程序链接。

我们在 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>

有一个代码来处理相关活动中的意图。 在android studio app link assistant中也得到了验证,如下:

它映射到正确的活动如下:

活动也有处理意图的代码。

但是,在点击 URL 时,而不是直接打开应用程序 - 我们将获得一个对话框来选择我们正在列出我们的应用程序的选项。

我们期待应用程序直接重定向并且没有这样的对话框。

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

【问题讨论】:

    标签: android deep-linking android-app-links


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-26
      • 1970-01-01
      • 2018-05-14
      • 1970-01-01
      • 2016-03-19
      • 1970-01-01
      相关资源
      最近更新 更多