This is the link which i created to share an url of a particular product in java class
String url="http://www.example.com/productId/";
String finalurl = url + productId.getText().toString();
Intent i = new Intent(Intent.ACTION_SEND);
i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
i.setType("*/*");
i.putExtra(Intent.EXTRA_STREAM, getLocalBitmapUri(bitmap));
i.putExtra(Intent.EXTRA_TEXT, name.getText().toString()+ "\n" + finalurl);
startActivity(Intent.createChooser(i, "Share Image"));
this is the intent filter that has created to an activity through App links Assistant
<activity
android:name=".login.Launchscreen"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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:host="www.example.com"
android:pathPrefix="/productId"
android:scheme="http" />
</intent-filter>
<tools:validation testUrl="http://www.example.com/productId/" />
</activity>
this is the java code through which i can extract the data which i appended to my link
Intent intent = getIntent();
String appLinkAction = intent.getAction();
Uri appLinkData = intent.getData();
if (Intent.ACTION_VIEW.equals(appLinkAction) && appLinkData != null) {
proid = appLinkData.getLastPathSegment();
}
through above code i can share url through whatsapp and when i click on the shared app link it is redirecting to my app successfully but what i need is i want to redirect the user to play store when my application is not in his device and when the application is in his device he should be navigated to particular activity. can anyone help me please.All i want is in android app.Thanks in advance