Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Once you have the intent and custom url scheme for your app set up, this javascript code at the top of a receiving page has worked for me on both iOS and Android:</p> <pre><code>&lt;script type="text/javascript"&gt; // if iPod / iPhone, display install app prompt if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i) || navigator.userAgent.match(/android/i)) { var store_loc = "itms://itunes.com/apps/raditaz"; var href = "/iphone/"; var is_android = false; if (navigator.userAgent.match(/android/i)) { store_loc = "https://play.google.com/store/apps/details?id=com.raditaz"; href = "/android/"; is_android = true; } if (location.hash) { var app_loc = "raditaz://" + location.hash.substring(2); if (is_android) { var w = null; try { w = window.open(app_loc, '_blank'); } catch (e) { // no exception } if (w) { window.close(); } else { window.location = store_loc; } } else { var loadDateTime = new Date(); window.setTimeout(function() { var timeOutDateTime = new Date(); if (timeOutDateTime - loadDateTime &lt; 5000) { window.location = store_loc; } else { window.close(); } }, 25); window.location = app_loc; } } else { location.href = href; } } &lt;/script&gt; </code></pre> <p>This has only been tested on the Android browser. I am not sure about Firefox or Opera. The key is even though the Android browser will not throw a nice exception for you on <code>window.open(custom_url, '_blank')</code>, it will fail and return <code>null</code> which you can test later.</p> <p>Update: using <code>store_loc = "https://play.google.com/store/apps/details?id=com.raditaz";</code> to link to Google Play on Android.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload