Android App Links

概述

通过 Branch 可以轻松启用 Android App Link,同时对其进行重大改进,提供完整的归因,支持 Android App Link 失败的个别案例,并允许您在用户未安装应用的情况下进行深度链接。请注意,Android App Link 仅适用于Android 6+;剩下的就由 Branch 处理!

设置

1. 生成签名证书指纹

  1. Start by generating a SHA256 fingerprint of your app's signing certificate.
    a. Navigate to your keystore file. This is the file that you use to build the debug and production version of your APK file before deploying it.
    b. Run this command to generate the fingerprint: keytool -list -v -keystore xxxx-example-my-release-key.keystore
    c. You'll see a value like
    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
    的值。请复制它。
  2. 现在,您可以通过执行以下操作在 Branch 操作后台 (Dashboard)上启用 App Link:
    a. 转到 Branch 操作后台 (Dashboard)的Configuration页面。
    b. 在Android 部分中切换Enable App Links复选框。
    c. 将复制的指纹值粘贴到出现的SHA256 Cert Fingerprints字段中。您可以同时插入调试和产品指纹以进行测试。您只需用逗号将它们分开。
    d. 向下滚动并点击Save
  3. Now, add your Intent Filter to Manifest by going to the Link Domain section on the Configuration page.
    a. Copy your domain name.
    b. Choose the Activity you want to open up when a link is clicked. This is typically your SplashActivity or a BaseActivity that all other activities inherit from (and likely the same one you selected in the SDK integration guide.
    c. Inside your AndroidManifest.xml, locate where the selected Activity is defined.
    d. Within the Activity definition, insert the intent filter provided below (making sure that xxxx matches the subdomain prefix you've been assigned or selected for yourself). Add this as its own separate intent filter.
    e. If you use a custom domain or subdomain for your Branch links, you should also add an entry for:
<data android:scheme="https" android:host="mycustomdomainorsubdomain" />
<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" android:host="xxxx.app.link" />
    <data android:scheme="https" android:host="xxxx-alternate.app.link" />
    <data android:scheme="https" android:host="xxxx.test-app.link" />
    <data android:scheme="https" android:host="xxxx-alternate.test-app.link" />
</intent-filter>

🚧

域验证

域验证
系统必须能够对照各自 Web 域上托管的 Digital Asset Links 文件,验证 URL intent filter 的数据元素中指定的每个主机。如果任何验证失败,则该应用不会被验证为应用的 intent filter 中定义的任何 URL 模式的默认处理程序。您可以使用 Google 的Statement List Asset Generator测试现有的 statement file。

2. 获取 APK SHA256 指纹

  1. Run: keytool -printcert -jarfile my_app.apk on your APK file.

这个页面对您有帮助吗?