I am trying to making a demo of deep linking concept in android.
Requirement
- I want to open my app while user click on one specific link. If my application is not installed in device than user automatically redirect me on play store.
- I also want to make this link dynamically. I want pass any data through link like below.
"myscheme://example.com/?faqid=95" faqid will be decided at dynamically.
Code Discription
I have take one activity call MainActivity and modify Manifiest like below.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:host="example.com" android:scheme="myscheme"/>
<data android:host="www.example.com" android:scheme="myscheme"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
Than after I have make one html file which is contain one link. while user press this link than my app will launch. I have doing following code in my html file.
<html>
<body>
<a href="myscheme://example.com/">This is a link</a>
</body>
</html>
But while user click one this link than my app not launch.I don't know where I'm getting wrong.