Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch.io deeplink in android opens Play Store even no matter what

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

like image 622
Lisa Anne Avatar asked Oct 02 '15 05:10

Lisa Anne


3 Answers

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"
    }
    ...
like image 85
Mattia Maestrini Avatar answered Nov 03 '22 11:11

Mattia Maestrini


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.

like image 31
harshitpthk Avatar answered Nov 03 '22 11:11

harshitpthk


In the dashboard setting/link setting/

select custom URL and enter your package name of your application

like image 1
Siddharth Vanakudari Avatar answered Nov 03 '22 11:11

Siddharth Vanakudari