I'm working with firebase dynamic links on android to generate links programmaticaly when a user shares a specific content .
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT,"Subject");
sendIntent.setType("text/plain");
FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLongLink(Uri.parse("https://organization.page.link/?link=https://www.organization.com/content.htm"))
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
.buildShortDynamicLink()
.addOnCompleteListener((Activity) context, task -> {
if (task.isSuccessful()) {
sendIntent.putExtra(Intent.EXTRA_TEXT, task.getResult().getShortLink());
context.startActivity(Intent.createChooser(sendIntent, "Share")));
}
});
Everything works fine here, except when the receiver of the dynamic link doesn't have the app installed , so it redirects him to the website instead of Play Store. I have tried .setFallbackUrl() but it doesn't work.