深度链接不适用于 Android 中的某些消息应用程序

发布于 2025-01-14 01:43:42 字数 1010 浏览 5 评论 0原文

我正在开发一个安卓应用程序。

它使用 AppsFlyer 的 Onelink 类型的 Deeplink。

我设置并测试过,总体来说,效果很好。 当我使用 Android studio 测试这个时,它工作正常 输入图片这里的描述

当我用 Slack Messenger 测试这个时,它也工作得很好。

但如果我用其他消息应用程序测试它,它不起作用,只需打开网络浏览器即可。

我不知道为什么以及如何解决它。


<intent-filter
    android:autoVerify="true"
    android:label="@string/app_name">

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

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

    <data
        android:host="mylink.com"
        android:pathPrefix="/path"
        android:scheme="https" />
</intent-filter>

输入图片此处描述

I am developing an android app.

It uses AppsFlyer's Onelink kind of a Deeplink.

I set up and tested, in general, it works fine.
When I tested this using Android studio, it works fine
enter image description here

When I tested this with Slack messenger, it works fine too.

But If I test this with other messaging apps, it doesn't work, and just open the web browser.

I don't know why and how to fix it.


<intent-filter
    android:autoVerify="true"
    android:label="@string/app_name">

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

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

    <data
        android:host="mylink.com"
        android:pathPrefix="/path"
        android:scheme="https" />
</intent-filter>

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

来世叙缘 2025-01-21 01:43:42

要使深层链接在 Android 12 中正常工作,您需要使用 autoVerify="true" 创建 intent-filters

<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:scheme="https" />
  <data android:scheme="https" />
  <data android:host="www.example.com" />
  <data android:host="mobile.example.com" />
</intent-filter>

在以下位置托管数字资产链接 JSON您的网站位于以下位置,以声明您的意图过滤器与网站之间的关联。

https://your-domain.name/.well-known/assetlinks.json

assertlinks.json 应包含以下信息

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "your.app.package.name",
    "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]

您可以使用 java 密钥工具生成 sha256_cert_fingerprints

keytool -list -v -keystore my-release-key.keystore

如果您使用 Play 应用签名,您可以找到数字资产链接 JSON< /strong> 代码片段位于以下位置 Release >设置>应用程序完整性

For deep linking to work in Android 12, you need to create intent-filters with autoVerify="true"

<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:scheme="https" />
  <data android:scheme="https" />
  <data android:host="www.example.com" />
  <data android:host="mobile.example.com" />
</intent-filter>

Host a Digital Asset Links JSON on your website at the below location to declare the association between your intent filters and the website.

https://your-domain.name/.well-known/assetlinks.json

assertlinks.json should contain the following information

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "your.app.package.name",
    "sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]

You can generate sha256_cert_fingerprints using java key tool

keytool -list -v -keystore my-release-key.keystore

If you're using Play App Signing, You can find Digital Asset Links JSON snippet at the following location Release > Setup > App Integrity

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文