2015-12-02 03:33:08 +08:00
import { initAngular1 } from './ng1' ;
initAngular1 ( ) ;
2015-11-30 06:30:15 +08:00
const DEVICE_READY_TIMEOUT = 2000 ;
2015-12-02 03:33:08 +08:00
2015-11-30 11:52:20 +08:00
export * from './plugins/actionsheet' ;
2015-12-01 01:09:50 +08:00
export * from './plugins/ble' ;
2015-11-30 11:52:20 +08:00
export * from './plugins/camera' ;
2015-12-01 12:15:21 +08:00
export * from './plugins/calendar' ;
2015-12-01 01:09:50 +08:00
export * from './plugins/contacts' ;
2015-11-30 11:52:20 +08:00
export * from './plugins/device' ;
2015-12-01 10:17:55 +08:00
export * from './plugins/facebook' ;
2015-12-01 02:34:54 +08:00
export * from './plugins/geolocation' ;
2015-11-30 11:52:20 +08:00
export * from './plugins/statusbar' ;
2015-11-29 06:24:38 +08:00
export * from './plugins/toast' ;
2015-11-30 06:30:15 +08:00
2015-12-02 03:33:08 +08:00
declare var window ;
import { ActionSheet } from './plugins/actionsheet' ;
import { BLE } from './plugins/ble' ;
import { Camera } from './plugins/camera' ;
import { Calendar } from './plugins/calendar' ;
import { Device } from './plugins/device' ;
import { Facebook } from './plugins/facebook' ;
import { Geolocation } from './plugins/geolocation' ;
import { StatusBar } from './plugins/statusbar' ;
import { Toast } from './plugins/toast' ;
// Window export to use outside of a module loading system
window [ 'IonicNative' ] = {
ActionSheet : ActionSheet ,
BLE : BLE ,
Camera : Camera ,
Calendar : Calendar ,
Device : Device ,
Facebook : Facebook ,
Geolocation : Geolocation ,
StatusBar : StatusBar ,
Toast : Toast
}
2015-11-30 07:20:11 +08:00
// 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.
2015-12-01 03:27:25 +08:00
let before = + new Date ;
2015-11-30 06:30:15 +08:00
let didFireReady = false ;
2015-12-01 03:27:25 +08:00
document . addEventListener ( 'deviceready' , function ( ) {
console . log ( 'DEVICE READY FIRED AFTER' , ( + new Date - before ) , 'ms' )
2015-11-30 06:30:15 +08:00
didFireReady = true ;
} )
setTimeout ( function ( ) {
if ( ! didFireReady && window . cordova ) {
console . warn ( '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 ) ;