'Navigation is blocked' when opening Intent


I am working on the payment process for an app. When the user has paid in the browser he has to get redirected back to the app.

My solution is to open an Intent from the browser. To achieve this I made a button and clicked it using javascript:

<body onload="document.getElementById('backToApp').click();">
    <a style="margin: 50px auto;" id="backToApp" class="btn btn-success" href="intent://app/#Intent;scheme={{ scheme }};package={{ package }};S.data={{ data }};end">Return to app</a> 

The only problem is that when I open the site in my mobile browser the Chrome debugger says: Navigation is blocked. Is there a way to fix this?


I found the problem a while ago, forgot to mention it here, sorry! You only can open an app with an intent if you have opened this site/session with your app.
So if you go to the page with the intent button in your browser by typing the URL. You will get ‘Navigation is blocked’.
If you open the page by redirecting there from your app and you click the button, it works!

Answered By – Bart Bergmans

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published