You'll need to embed this data into the path that you append to the URI scheme. Let's say you set up your Activity with the following intent filter with the custom scheme of myapp:
<intent-filter>
<data android:scheme="myapp" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
Now, create a link and append all of the data you want to the URI scheme in the form of query parameters:
myapp://open?custom_param1=val1
Then, in onCreate
, you can parse the intent
Uri data = this.getIntent().getData();
if (data != null && data.isHierarchical() && activity != null) {
if (data.getQueryParameter("custom_param1") != null) {
String param1 = data.getQueryParameter("custom_param1");
// do some stuff
}
}
Or you can use a service like Branch that lets you bundle unlimited data in JSON format into a link, that is retrieved on link click and app open. It makes this process much easier.