Pattern Matches Deep Link Android

Jaspreet Singh
McAppMedia
Published in
1 min readJul 19, 2020

How could we match path pattern in deep links? We have menifest file in android app and we want if deep links contains some parameters only then our app will be open from Search result .

Suppose our deep links contains https://www.example.com/first/second/third. Now what will be our pattern in menifest.

Open your menifest and go to activity tag and add intent filter in that.

<activity name = "MainActivity">
<intent-filter
<data android:scheme = "https" />
<data android:host ="example.com"/>
<data amdroid:pathPattern = "..*/..*/..* />

Suppose we want to match second path variable

<activity name = "MainActivity">
<intent-filter
<data android:scheme = "https" />
<data android:host ="example.com"/>
<data amdroid:pathPattern = "..*/second/..* />

Suppose we want to match first path variable

<activity name = "MainActivity">
<intent-filter
<data android:scheme = "https" />
<data android:host ="example.com"/>
<data amdroid:pathPattern = "first/..*/..* />

I have implemented this in my app https://play.google.com/store/apps/details?id=com.mcmedia.kidslearningapp

--

--

Jaspreet Singh
McAppMedia

Working in Android Developemen and Tech Mentor .My Github profile is: https://github.com/jaspreet1990 , Contact me at preetjaspreet90@gmail.com for more info.