JavaScript Methods Not Executing Consistently In Mobile Safari vs. Android Chrome
<p>I have a method in JavaScript that looks as follows:</p>

<pre><code>function onAction() {
    getValue1();
    getValue2();
    getValue3();
}
</code></pre>

<p>When I call onAction() I see two different behaviors between Mobile Safari and Android Chrome.  In Safari, I get the values for all three methods.  On Android Chrome, I only get the value of the last method.  It doesn't matter which one is last.  I suspected it may be an execution timing issue and attempted the following:</p>

<pre><code>function onAction() {

    new Promise(function(resolve,reject) {
        resolve(1);
    })
    .then(function() {
        getValue1();
    })
    .then(function() {
        getValue2();
    })
    .then(function() {
        getValue3();
    });
}           
</code></pre>

<p>Again, it works fine in Mobile Safari, but not Android Chrome.</p>

<p>I'm sure I'm missing something obvious, but it's eluding me.  If it matters, the getValue* functions are used to get values via each platform's mechanism for Native Code->JavaScript bridging.</p>

<p>Any help is appreciated.  Please let me know if I can supply any more information.</p>

<p>Regards,<br>
Rob</p>

<p>**Additional Info **<br>
The <code>getValueX</code> functions don't return any values.  They trigger values to be pushed over to the native wrapper: </p>

<pre><code>function getReaderSDKVersion() {
    var message = {'action' : MPDataEnum.SDKVersion};
    raiseMessage(message);
}

function raiseMessage(message) {
    if (isPlatformiOS()) {
        window.webkit.messageHandlers.interOp.postMessage(message);
    } else {
        var url = "mpcard://runMethod#" + JSON.stringify(message);
        window.location.href = url;
    }
}
</code></pre>