Cordova iOS deviceready never fires
<p>I've been developing Cordova apps for a number of years now, and often I come across the problem where the "deviceready" event simply does not fire in iOS.<br>
(This is not the <code>cordova.js</code> file missing, which seems to be the only answer I'm finding on SO).<br>
Currently I'm using <strong>Cordova v6.3.1</strong>, though I've had this same issue on many earlier versions.</p>

<p>Surely others face this issue - I'm going to try and solve it now and will post the answer here.</p>

<hr>

<p>Sample <code>index.html</code> code:</p>

<pre><code>&lt;html&gt;
    &lt;body&gt;
        &lt;script src="cordova.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            document.addEventListener("deviceready", 
               function() { alert('device ready fired!'); }, false);
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>