Android deeplink per flavor

You have to provide each product flavor a manifest file of their own, within which you can specify distinct URI pattern for deep links.

You can refer to Configure Build Variants and Merge Multiple Manifest Files for details about how to achieve that, and more things about building app for product flavor.


For people visiting this in 2019: You can use manifestPlaceholders per flavor. In your case:

productFlavors {
  app1{
    applicationId "com.apps.app1"
    manifestPlaceholders.scheme = "app1"
  }
  app2{
    applicationId "com.apps.app2"
    manifestPlaceholders.scheme = "app2"
  }
  app3{
    applicationId "com.apps.app3"
    manifestPlaceholders.scheme = "app3"
  }
}

and then use it in your manifest:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
    android:pathPrefix="/"
    android:scheme="${scheme}" />