NativeJS Bridge is a powerful method for dynamically controlling and interacting with native components in your app, directly from your website via javascript. 

Overview of NativeJS Bridge available in our docs at https://gonative.io/docs#native-bridge-overview.

When making multiple simultaneous calls to the NativeJS bridge, subsequent assignments of window.location.href will overwrite the earlier assignments. The result is that only the last command will be executed. For example:

window.location.href = ... // first command
// later...
window.location.href = ... // second command overwrites the first one

One solution is to introduce a small (500ms) delay before running the second command:window.location.href = ... // first command

setTimeout(function() {
window.location.href = ... // second command
}, 500);

The second solution is to pack both commands into a single NativeJS call to gonative://nativebridge/multi:

var urls = ['gonative://...', 'gonative://...'];
var json = {urls: urls};
window.location.href = 'gonative://nativebridge/multi?data=' + encodeURIComponent(json);

 

More info at https://gonative.io/docs#native-js-multi