Opening Android Application when particular "Host" is opened in Android mobile browser or particular Link is opened Also named as Mobile DeepLinking.
We need to define host & scheme in the intent filters of the activity, which we need to open when link or host is opened.
Below is the code for opening app when particular Host is opened.
<activity android:name=".ActivityName"> <intent-filter> <action android:name="android.intent.action.GALLERY" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.DEFAULT" /> <data android:host="http" android:scheme="abc.com" /> </intent-filter> </activity>
Below is the code for opening app when we are trying particular Link in browser.
<activity android:name=".ActivityName"> <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:scheme="http" android:host="abc.com" android:pathPrefix="/images/" /> <data android:scheme="https" android:host="abc.com" android:pathPrefix="/images/" /> </intent-filter> </activity>
Cheers!!
No comments:
Post a Comment