Enabling Deeplinks
Add required permissions to AndroidManifest.xml
Add Intent Filters in the AndroidManifest.xml
Deeplinks
<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="myapp"
</intent-filter>
Web links
<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" />
<data android:scheme="https" />
<data android:host="mydomain.com" />
</intent-filter>
Android App links
<intent-filter android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="mydomain.com" />
</intent-filter>
Here is an example of the relevant paths which should be added to the URL Mapping editor:
This will have setup the intent-filter
within the Manifest file, as follows:
....
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleInstancePerTask"
android:theme="@style/Theme.ShoppingCart">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="mi.example.com"
android:pathPrefix="/p/cpm" />
</intent-filter>
<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="https"
android:host="mi.example.com"
android:pathPrefix="/p/rpm" />
</intent-filter>
<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="https"
android:host="mi.example.com"
android:pathPrefix="/p/gom" />
</intent-filter>
</activity>
Official documentation shows an overview of how to test the app links within Android Studio.
Instantiating the SDK
Within the Application()
class, the MIClient.start()
method will have to be invoked: