Reputation: 1146
We have an Andriod app from where we are starting a brower experiance and loading a page.
On the browser page their are two buttons "Agree" and "Cancel". We have a deep link URL which is being called on click of both buttons and take user back to the app from where the journey started.
Only difference in the functionality is on click of "Agree" we are doing backed calls and after we get response which is taking around 10-15 seconds we are just redirecting chrome to deep link url.
"Cancel" is working seem-less, but on click of "Agree" button browser is not able to understand deep-link url and doing the redirect in same browser session.
This is how we are redirecting chrome to deep-link url.
window.location.replace(redirectUrl);
Upvotes: 1
Views: 408
Reputation: 1146
Here is the conclusion from our debugging. We found out that there is nothing missing in the code.
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.
On click of Cancel button it is working all the time as there is no backend call. On Agree button we are calling backend and on completion of a promise we are redirecting back to App. In that scenario chrome is not treating this as a user gesture all the time so failing intermittently.
One way to solve this issue is instead of opening a new browser window open experience in Android WebView.
Upvotes: 1