13

无论如何,当我点击使用 branch.io 创建的链接时,用户会被带到 Google Play :-((

这是清单中的相关活动:

<activity
        android:name=".activities.DetailActivity"
        android:configChanges="keyboard|screenSize|orientation"
        android:screenOrientation="portrait">
        <intent-filter>
            <data
                android:host="open"
                android:scheme="foo" />
            <action android:name="android.intent.action.VIEW" />

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

这是 branch.io 仪表板:

在此处输入图像描述

4

3 回答 3

7

Deferred Deep Linking SDK for Android README

Chrome 似乎一直带我去 Google Play。为什么?

Chrome 对直接打开应用程序非常挑剔。Chrome 利用意图系统来尝试打开应用程序,并且太容易失败返回到 Play 商店。这里有 3 件事需要验证:

  1. 确保测试构建的包名称与分支设置中注册的包匹配,并与 Google play 中的包匹配。

  2. 确保测试构建的 URI 方案与分支设置匹配。

  3. 验证您是否在清单中添加了正确的主机“打开” - 请参见此处

我看到您使用此应用程序作为示例。请检查您的应用程序的包名称是否为com.foo.inappbilling,否则该Branch.io链接将无法打开您的应用程序,并且始终会打开 Google Play 商店。

我能够重现您的问题,并通过设置正确的包名称来解决。如果你使用 Gradle,你可以直接从app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.foo.inappbilling"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    ...
于 2015-10-04T15:57:11.463 回答
1

您是否在方案定义上方的链接设置中的仪表板中检查(总是尝试打开应用程序)?还要确保您在清单中设置的方案没有“://”,请参阅@inverce 答案以获取更多描述。

于 2015-12-04T12:35:59.140 回答
1

在仪表板设置/链接设置/

选择自定义 URL 并输入您的应用程序包名称

于 2015-12-11T10:38:35.703 回答