rosu alin rosu alin - 24 days ago 10
Android Question

Deep link does not work with Branch

This is what I got in my Manifest:

<activity
android:name=".activities.VidyoSampleActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize">
<intent-filter>
<data android:scheme="facetalk" android:host="open"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_hjyeOhAByhF1x452yXtuEjdpCzhMiEAB" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="c13e89c059c32c08041932f2d48b4e5bf1054b4a" />


I am using this version: compile 'io.branch.sdk.android:library:2.+'

And I do in my Application class the initialisation.
This is the url scheme I have set on my dashboard.branch.io: facetalk://

But when I try this link:

facetalk://facetalk.vidyo-nl.com/mobile.html?key=saETMuvxjeW2akgzbyt46Xffio&guestname=Test123&secure=yes
It does nothing.

Why is that?
I even created the code for branch from the Fabric AndroidStudio plugin. and it still doesn't work. What am I doing wrong?
Let me know if more info is needed

PS: If I remove from the intent filter this:

android:host="open"


It will work. But I don't think it goes via branch like that. cause it doesn't enter this:

Branch branch = Branch.getInstance();
branch.initSession(new Branch.BranchReferralInitListener() {
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
if (error == null) {
Log.i("BranchConfigTest", "deep link data: " + referringParams.toString());
}
}
}, this.getIntent().getData(), this);


After adding some logs. I found out that this is getting logged, when the app starts the first time:

11-16 12:18:45.237: I/BranchConfigTest(25065): deep link data: {"+is_first_session":false,"+clicked_branch_link":true,"room":"DpoxihjuKKKE24FAP2ByTILdZsg","guestname":"John","secure":"true","$marketing_title":"Join Conference","$one_time_use":false,"~creation_source":1,"~feature":"marketing","~id":"325753563785928408","~marketing":true,"+click_timestamp":1479295095,"+match_guaranteed":true,"~referring_link":"https:\/\/facetalk.app.link\/join?room=DpoxihjuKKKE24FAP2ByTILdZsg&guestname=John&secure=true"}


I don't understand how this is being shown? Cause I just launch the app, I did not press any link.
Also when I press on a link I created, this does not get called anymore

Answer

The Branch.io Integration shows that I need to add the intent as this:

<intent-filter>
            <data android:scheme="facetalk" android:host="open"/>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

But that did not work for me for branch 2.x. This was the way I was able to add the intent:

   <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="facetalk.app.link" />
        </intent-filter>