7

I am using Branch.io to Deeplink from the Salesforce App to my Cordova app. However, when I click the deeplink in the Salesforce app, it just opens my app within a browser inside the Salesforce app instead of actually taking me to my app. It seems like I should be using a <intent-filter/> to make that happen but it doesn't seem to be able to take me out of the originating Salesforce app. Here is what my <intent-filter/> currently is:

 <intent-filter android:name="io.branch.sdk.UriScheme">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="myapp" />
 </intent-filter>
 <intent-filter android:autoVerify="true" android:name="io.branch.sdk.AppLink">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:host="myapp.app.link" android:scheme="https" />
</intent-filter>

What other intent actions or categories do I need there?

Rozgonyi
  • 1,027
  • 13
  • 27

2 Answers2

2

What actually definitively resolved this was going into the AndroidManifest.xml and setting android:launchMode="singleTask" on my main activity.

I know that in the android docs it says singleTask is not recommended. I believe that's because it prevents you from going back but we take over the functionality of the hardware back button so that's not relevant. Also according to this SO answer, it seems like the right thing to do in our context.

Rozgonyi
  • 1,027
  • 13
  • 27
1

You should only need the intent filters listed here:

If it is opening your app within the Salesforce browser, then it may be that Salesforce is preventing users from deep linking out of it.

Brian Chang
  • 169
  • 2
  • Ok, I checked the Salesforce app in the Settings app and found there was a setting to open linked within the salesforce app of in the other app. – Rozgonyi Apr 18 '18 at 16:47