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
declare var window ;
import { ActionSheet } from './plugins/actionsheet' ;
2016-03-13 07:04:30 +08:00
import { AppAvailability } from './plugins/appavailability' ;
2016-03-05 05:42:21 +08:00
import { AppRate } from './plugins/apprate' ;
import { AppVersion } from './plugins/appversion' ;
import { Badge } from './plugins/badge' ;
2016-03-13 07:04:30 +08:00
import { BarcodeScanner } from './plugins/barcodescanner' ;
import { BatteryStatus } from './plugins/batterystatus' ;
2015-12-02 03:33:08 +08:00
import { BLE } from './plugins/ble' ;
import { Calendar } from './plugins/calendar' ;
2016-03-13 07:04:30 +08:00
import { Camera } from './plugins/camera' ;
2016-03-05 00:33:36 +08:00
import { Clipboard } from './plugins/clipboard' ;
2015-12-02 08:47:24 +08:00
import { Contacts } from './plugins/contacts' ;
2016-03-05 05:42:21 +08:00
import { DatePicker } from './plugins/datepicker' ;
2015-12-02 03:33:08 +08:00
import { Device } from './plugins/device' ;
2016-03-13 07:04:30 +08:00
import { DeviceMotion } from './plugins/devicemotion' ;
import { DeviceOrientation } from './plugins/deviceorientation' ;
import { Dialogs } from './plugins/dialogs' ;
2015-12-02 03:33:08 +08:00
import { Facebook } from './plugins/facebook' ;
2016-03-13 07:04:30 +08:00
//import {File} from './plugins/file';
import { Flashlight } from './plugins/flashlight' ;
2015-12-02 03:33:08 +08:00
import { Geolocation } from './plugins/geolocation' ;
2016-03-13 07:04:30 +08:00
import { ImagePicker } from './plugins/imagepicker' ;
import { LaunchNavigator } from './plugins/launchnavigator' ;
import { LocalNotifications } from './plugins/localnotifications' ;
2015-12-02 08:47:24 +08:00
import { Push } from './plugins/push' ;
2016-03-13 07:04:30 +08:00
import { SMS } from './plugins/sms' ;
2015-12-02 03:33:08 +08:00
import { StatusBar } from './plugins/statusbar' ;
import { Toast } from './plugins/toast' ;
2015-12-02 09:06:38 +08:00
import { TouchID } from './plugins/touchid' ;
2015-12-02 03:33:08 +08:00
2015-12-02 08:47:24 +08:00
export {
ActionSheet ,
2016-03-13 07:04:30 +08:00
AppAvailability ,
2016-03-05 05:42:21 +08:00
AppRate ,
AppVersion ,
Badge ,
2016-03-13 07:04:30 +08:00
BarcodeScanner ,
BatteryStatus ,
2015-12-02 08:47:24 +08:00
BLE ,
Calendar ,
2016-03-13 07:04:30 +08:00
Camera ,
2016-03-05 00:33:36 +08:00
Clipboard ,
2015-12-02 08:47:24 +08:00
Contacts ,
2016-03-05 05:42:21 +08:00
DatePicker ,
2015-12-02 08:47:24 +08:00
Device ,
2016-03-13 07:04:30 +08:00
DeviceMotion ,
DeviceOrientation ,
Dialogs ,
2015-12-02 08:47:24 +08:00
Facebook ,
2016-03-13 07:04:30 +08:00
//File,
Flashlight ,
2015-12-02 08:47:24 +08:00
Geolocation ,
2016-03-13 07:04:30 +08:00
ImagePicker ,
LaunchNavigator ,
LocalNotifications ,
2015-12-02 08:47:24 +08:00
Push ,
2016-03-13 07:04:30 +08:00
SMS ,
2015-12-02 08:47:24 +08:00
StatusBar ,
2015-12-02 09:06:38 +08:00
Toast ,
2016-03-05 05:42:21 +08:00
TouchID
2015-12-02 08:47:24 +08:00
}
2016-03-11 00:29:03 +08:00
export * from './plugins/plugin' ;
2015-12-02 03:33:08 +08:00
// Window export to use outside of a module loading system
window [ 'IonicNative' ] = {
ActionSheet : ActionSheet ,
2016-03-13 07:04:30 +08:00
AppAvailability : AppAvailability ,
2016-03-05 05:42:21 +08:00
AppRate : AppRate ,
AppVersion : AppVersion ,
Badge : Badge ,
2016-03-13 07:04:30 +08:00
BarcodeScanner : BarcodeScanner ,
BatteryStatus : BatteryStatus ,
2015-12-02 03:33:08 +08:00
BLE : BLE ,
Calendar : Calendar ,
2016-03-13 07:04:30 +08:00
Camera : Camera ,
2016-03-05 05:42:21 +08:00
Clipboard : Clipboard ,
2015-12-02 08:47:24 +08:00
Contacts : Contacts ,
2016-03-05 05:42:21 +08:00
DatePicker : DatePicker ,
2015-12-02 03:33:08 +08:00
Device : Device ,
2016-03-13 07:04:30 +08:00
DeviceMotion : DeviceMotion ,
DeviceOrientation : DeviceOrientation ,
Dialogs : Dialogs ,
2015-12-02 03:33:08 +08:00
Facebook : Facebook ,
2016-03-13 07:04:30 +08:00
//File: File,
Flashlight : Flashlight ,
2015-12-02 03:33:08 +08:00
Geolocation : Geolocation ,
2016-03-13 07:04:30 +08:00
ImagePicker : ImagePicker ,
LaunchNavigator : LaunchNavigator ,
LocalNotifications : LocalNotifications ,
2015-12-02 08:47:24 +08:00
Push : Push ,
2016-03-13 07:04:30 +08:00
SMS : SMS ,
2015-12-02 03:33:08 +08:00
StatusBar : StatusBar ,
2015-12-02 09:06:38 +08:00
Toast : Toast ,
2016-03-05 05:42:21 +08:00
TouchID : TouchID
2016-03-07 04:27:26 +08:00
} ;
2015-12-02 03:33:08 +08:00
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 ( ) {
2016-03-07 04:27:26 +08:00
console . log ( 'DEVICE READY FIRED AFTER' , ( + new Date - before ) , 'ms' ) ;
2015-11-30 06:30:15 +08:00
didFireReady = true ;
2016-03-07 04:27:26 +08:00
} ) ;
2015-11-30 06:30:15 +08:00
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 ) ;