export function checkReady ( ) { const DEVICE_READY_TIMEOUT = 5000 ; const before = Date . now ( ) ; let didFireReady = false ; document . addEventListener ( 'deviceready' , ( ) => { console . log ( `Ionic Native: deviceready event fired after ${ Date . now ( ) - before } ms` ) ; didFireReady = true ; } ) ; setTimeout ( ( ) => { if ( ! didFireReady && ! ! window . cordova ) { console . warn ( `Ionic Native: deviceready did not fire within ${ DEVICE_READY_TIMEOUT }ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.` ) ; } } , DEVICE_READY_TIMEOUT ) ; }