I have a web page that I want to detect my Android App (in background) using intent-filter of course, so my App and my page do their work separately.
My android application handles a URL like the URL below using intent-filter:
myApp://sample?param=1
So I have an <a>
tag in my page which I clicked it using JavaScript (automatically):
<a href="myApp://sample?param=1" id="myAppLink"></a>
Everything works fine exept when I don't have my App installed (for example in PC or iOS).
In this situation the browser redirects to myApp://sample?param=1
(naturally).
Is there any way (in JavaScript I think) that I can detect if the app not handled my URL then I stop automatic clicking? Or other way (tricks of course) to know if the App installed then I call click event? Or some other workarounds to my problem?
Or can I call my URL (myApp://sample?param=1
) using AJAX or JSONP so my App detects it?
(I've tried this with jQuery Ajax without a chance. I don't know if the intent-filter could handle Ajax requests.)