I'm implementing deep-linking in android, what I'm trying to do is when a user clicks on the link, he gets redirected on the application, and this already works, but I also want that the user can see some values I pass inside the link.
Example:
My link is: https://examplelink.com/123456789. The application needs to get 123456789 code.
How do I do this?
NB: I've alredy put this on the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sendsharedlink">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
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 android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="https"
android:host="examplelink.com" />
</intent-filter>
</activity>
</application>
I HAVE RESOLVED BY PUTTING:
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
String[] link = data.toString().split("/");
txt.setText(link[3]);
Thanks for the help.