I am trying to do deep linking such that when a user opens a webpage it automatically opens the app
<!DOCTYPE html>
<html>
<body>
<a href="myapp://data/">Open App</a>
<script>
window.location = 'myapp://data/';
link = document.querySelector('a')
link.click();
</script>
</body>
</html>
Currently when the user clicks the link, everything works but nothing works if i try to automatically trigger the deep link, neither using window.location for redirect or triggering a click event on the link seems to be working.
I need a way to automatically redirect to the deep link and not wait for the user to click on the "Open App" link
Deep linking will not work if the event is not user-driven. By default, Chrome is the browser that handles deep linking in Android.
And Chrome doesn't launch an external app for a given Intent URI in the following cases.
- When the Intent URI is redirected from a typed in URL.
- When the Intent URI is initiated without user gesture.
See: https://developer.chrome.com/docs/multidevice/android/intents/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With