13

No matter what, when I click on a link created with branch.io, the user is taken to Google Play :-((

This is the relevant activity in the manifest:

<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>

This is the branch.io dashboard:

enter image description here

Tim
  • 41,901
  • 18
  • 127
  • 145
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157

3 Answers3

7

From the Deferred Deep Linking SDK for Android README:

Chrome seems to take me to Google Play all the time. Why?

Chrome is very picky about opening up the app directly. Chrome utilizes the intent system to try to open up the app, and fails back to the Play Store far too easily. Here are 3 things to verify:

  1. Make sure the package name for the test build matches the package registered in the Branch settings and matches the package in Google play.

  2. Make sure the URI scheme of the test build matches the Branch settings.

  3. Verify that you've added the proper host 'open' in the Manifest - see here

I see that you use this app as example. Please check that the package name of your application it is com.foo.inappbilling, otherwise the Branch.io link will not open your app and will always open the Google Play Store.

I was able to reproduce your issue and I solved by setting the correct package name. If you use Gradle you can do it directly from 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"
    }
    ...
Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94
  • One thing to add, "Support existing routing based on this URI scheme is selected". If that's the case, foo:// is going to open + whatever is specified for the key $deeplink_path. So, $deeplink path will need bar! – Sahil Verma Oct 05 '15 at 17:52
  • @Mattia Maestrini: Must we set `host` to `open`, or we can use any keyword? – anticafe Jan 27 '16 at 09:10
1

have you checked (always try to open app) in your dashboard inside link settings above the scheme definition? Also make sure the scheme you set in the manifest is without "://" refer @inverce answer for more description.

harshitpthk
  • 4,058
  • 2
  • 24
  • 32
1

In the dashboard setting/link setting/

select custom URL and enter your package name of your application