@ionic-native/core
Version:
Ionic Native - Native plugins for ionic apps
22 lines • 1.2 kB
JavaScript
export function checkReady() {
if (typeof process === 'undefined') {
var win_1 = typeof window !== 'undefined' ? window : {};
var DEVICE_READY_TIMEOUT_1 = 5000;
// To help developers using cordova, we listen for the device ready event and
// log an error if it didn't fire in a reasonable amount of time. Generally,
// when this happens, developers should remove and reinstall plugins, since
// an inconsistent plugin is often the culprit.
var before_1 = Date.now();
var didFireReady_1 = false;
win_1.document.addEventListener('deviceready', function () {
console.log("Ionic Native: deviceready event fired after " + (Date.now() - before_1) + " ms");
didFireReady_1 = true;
});
setTimeout(function () {
if (!didFireReady_1 && win_1.cordova) {
console.warn("Ionic Native: deviceready did not fire within " + DEVICE_READY_TIMEOUT_1 + "ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.");
}
}, DEVICE_READY_TIMEOUT_1);
}
}
//# sourceMappingURL=bootstrap.js.map