【问题标题】:Branch.io deeplink in android opens Play Store even no matter whatandroid中的Branch.io deeplink无论如何都会打开Play商店
【发布时间】:2015-10-02 05:17:29
【问题描述】:

无论如何,当我点击使用 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 仪表板:

【问题讨论】:

    标签: android branch.io


    【解决方案1】:

    来自Deferred Deep Linking SDK for Android README

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

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

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

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

    3. 验证您是否在 Manifest 中添加了正确的“打开”主机 - 请参阅 here

    我看到你用这个app 作为例子。请检查您的应用程序包名称是否为com.foo.inappbilling,否则Branch.io 链接将无法打开您的应用程序,并且始终会打开Goog​​le 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"
        }
        ...
    

    【讨论】:

    • 要补充一点,“选择支持基于此URI方案的现有路由”。如果是这种情况, foo:// 将打开 + 为键 $deeplink_path 指定的任何内容。所以,$deeplink 路径需要 bar!
    • @Mattia Maestrini:我们必须将host 设置为open,还是可以使用任何关键字?
    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

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

      【讨论】:

      • 这行不通,而且非常正确,因为包名不是 URL。
      • 没有包名就无法从 url 打开应用程序,这在我的应用程序中完美运行
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-24
      相关资源
      最近更新 更多