How to open Mobile Application from Web Browser using Javascript


I would like to open an Android or IOS application from the web browser using Javascript.

The condition is this: If the application does not exists, AppStore or PlayStore would open instead.

I have tried:

var loadedAt = +new Date;
	                       if (+new Date - loadedAt < 2000){
	                   window.location = 'market://details?id=someApp;

But In Android, both the app and the PlayStore always opens.

Can I have the PlayStore open only if the App is not installed?

Please help. Thanks.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.