Quiero hacer clic en un enlace que inicia una aplicación en Android. Sin embargo, si la aplicación no está instalada, por defecto, Android redirige a Play Store. no quiero esto
Lo que quiero es poder redirigir a una página web personalizada si la aplicación no está instalada. iOS parece admitir esto mediante el uso de setTimeouts, pero según esta página https://vhudyma-blog.eu/open-mobile-application-from-the-browser/ no se ofrece un flujo similar para Android. Gracias por tu ayuda.
if (isAndroid) { const url = "intent://instagram.com/#Intent;scheme=https;package=com.instagram.android;end"; // open the app // if the app isn't installed, it seems we just go to the play store window.location.replace(url); } else if (isIOS) { // go to the app window.location.replace("instagram://"); // open the app store on a timeout. this will happen but not be seen if instagram has opened setTimeout(() => { window.location.replace( "https://apps.apple.com/us/app/instagram/id389801252" ); }, 10000); } else { // we're not in ios or android so just go to the website window.location.replace("https://instagram.com"); }Es posible que tenga un poco de suerte con getInstalledRelatedApps()
const list = await navigator.getInstalledRelatedApps();Aquí hay un artículo al respecto: https://web.dev/get-installed-related-apps/
Aunque puede que no tenga demasiado apoyo .