Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open android app from browser when page loads

I want to open my app when user goes for example:

www.example.com/myApp

<a href="id="a" intent://something#Intent;scheme=myapp;package=com.example.myapp;end;">open app</a>

and if i click this link, it works, but i want my app to be opened without click, when page loads.

I have tried:

window.onload = function () {
        window.location.replace("intent://something#Intent;scheme=myapp;package=com.example.myapp;end;");            
    }

and

window.onload = function () {window.location.href = "intent://something#Intent;scheme=myapp;package=com.example.myapp;end;";}

even

window.onload = function(){document.getElementById("a").click();}

but none of these work.

like image 918
gmaziashvili Avatar asked Dec 12 '18 07:12

gmaziashvili


1 Answers

Folks who are having the same issues on universal linking where they need to app link without user action. we have not been able to app link without user interaction. Google chrome does block the app linking from the URL.

Hence request you all to take user interaction based approach.which is 100% valid approach for universal linking on all the device OS Android or iOS.

like image 122
Tejas Avatar answered Oct 10 '22 01:10

Tejas