5

When using Huawei App Links (Because Firebase dynamic link doesn't work for Huawei App Gallery), this is the kind of long link that is generated.

https://example.drcn.agconnect.link/?deeplink=https%3A%2F%2Fexample.com%2Freferral%2F3c3432x&android_deeplink=https%3A%2F%2Fexample.com%2Freferral%2F3c3432x&android_open_type=2&android_package_name=com.example.mobile

When clicked on this link on an Android(Google) device where my app is not installed, I see these options:

enter image description here

"Open" - opens the deep link i.e https://example.com/referral/3c3432x in a browser

"Download" - opens the Google play store app with my app page

The download behavior is fine, but I don't want the open behavior, since that link actually does not exist. I understand this link still be accessed on a desktop and might try to go to the link on a browser, but for now we are okay showing 404 in such cases.

Is there a way to avoid the "Open" option? Or better would be to stop showing this screen and immediately redirect to application if installed or play store of not installed. Just like how Firebase does.

I even tried the option of landing_page_type=2 as listed here: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-applinking-createlinks-defined-0000001055514692 but that doesn't seem to work, it always show the Open/Download page irrespective of the value.

Rob
  • 14,746
  • 28
  • 47
  • 65
Housefly
  • 4,324
  • 11
  • 43
  • 70
  • "If `landing_page_type` is left empty, value 2 will be used by default." 2 is the default value anyway, you didn't change anything. Did you try to change `android_open_type`? – Kevin M. Mansour Feb 05 '23 at 01:15
  • If I really understand this messy documentation, try to set `android_fallback_url` and `android_open_type` so the open button will redirect to somewhere else rather than an empty screen but I think you can't remove it. – Kevin M. Mansour Feb 05 '23 at 01:24
  • @KevinM.Mansour yeah I tried that too. I set the `android_open_type` to `2` which means `open app details page on the local app store` but still the Open button is opening the url in browser. Also if we read about the default value conditions for this it says `If both android_package_name and android_fallback_url have a value, the value of android_open_type will be 3.` So we are not supposed to set both package and fallback url, then that would come as a custom url. – Housefly Feb 05 '23 at 12:31
  • function openApp() { var intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com/referral/3c3432x")); intent.setPackage("com.example.mobile"); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } else { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.example.mobile"))); } } – GHULAM NABI Feb 09 '23 at 06:20

0 Answers0