2016-08-17 04:09:34 -03:00
import { initAngular1 } from './ng1' ;
2015-12-01 13:33:08 -06:00
2017-01-16 15:33:59 -06:00
const DEVICE_READY_TIMEOUT = 5000 ;
2015-11-29 16:30:15 -06:00
2015-12-01 13:33:08 -06:00
declare var window ;
2016-08-17 04:09:34 -03:00
import { ActionSheet } from './plugins/actionsheet' ;
import { AdMob } from './plugins/admob' ;
2016-07-23 07:13:35 -04:00
import { AndroidFingerprintAuth } from './plugins/android-fingerprint-auth' ;
2016-08-17 04:09:34 -03:00
import { AppAvailability } from './plugins/appavailability' ;
import { AppRate } from './plugins/apprate' ;
import { AppVersion } from './plugins/appversion' ;
import { Badge } from './plugins/badge' ;
import { BackgroundGeolocation } from './plugins/background-geolocation' ;
import { BackgroundMode } from './plugins/backgroundmode' ;
2017-01-21 05:14:29 +08:00
import { Backlight } from './plugins/backlight' ;
2016-08-17 04:09:34 -03:00
import { BarcodeScanner } from './plugins/barcodescanner' ;
import { Base64ToGallery } from './plugins/base64togallery' ;
import { BatteryStatus } from './plugins/batterystatus' ;
import { Brightness } from './plugins/brightness' ;
import { BLE } from './plugins/ble' ;
import { BluetoothSerial } from './plugins/bluetoothserial' ;
2017-01-21 05:11:19 +08:00
import { Broadcaster } from './plugins/broadcaster' ;
2016-08-17 04:09:34 -03:00
import { Calendar } from './plugins/calendar' ;
2016-08-27 02:02:07 -04:00
import { CallNumber } from './plugins/call-number' ;
2016-08-17 04:09:34 -03:00
import { Camera } from './plugins/camera' ;
import { CameraPreview } from './plugins/camera-preview' ;
import { CardIO } from './plugins/card-io' ;
import { Clipboard } from './plugins/clipboard' ;
2016-08-26 11:06:26 -05:00
import { CodePush } from './plugins/code-push' ;
2016-08-17 04:09:34 -03:00
import { Contacts } from './plugins/contacts' ;
import { Crop } from './plugins/crop' ;
import { DatePicker } from './plugins/datepicker' ;
import { DBMeter } from './plugins/dbmeter' ;
import { Deeplinks } from './plugins/deeplinks' ;
import { Device } from './plugins/device' ;
2016-10-15 07:41:06 -07:00
import { DeviceFeedback } from './plugins/device-feedback' ;
2016-08-17 04:09:34 -03:00
import { DeviceAccounts } from './plugins/deviceaccounts' ;
import { DeviceMotion } from './plugins/devicemotion' ;
import { DeviceOrientation } from './plugins/deviceorientation' ;
import { Diagnostic } from './plugins/diagnostic' ;
import { Dialogs } from './plugins/dialogs' ;
import { EmailComposer } from './plugins/emailcomposer' ;
2016-08-26 07:53:18 -04:00
import { EstimoteBeacons } from './plugins/estimote-beacons' ;
2016-08-17 04:09:34 -03:00
import { Facebook } from './plugins/facebook' ;
import { File } from './plugins/file' ;
2016-08-27 14:35:12 -04:00
import { FileChooser } from './plugins/file-chooser' ;
2016-08-27 14:43:57 -04:00
import { FileOpener } from './plugins/file-opener' ;
2016-10-18 12:05:19 +02:00
import { FilePath } from './plugins/filepath' ;
2016-08-17 04:09:34 -03:00
import { Transfer } from './plugins/filetransfer' ;
2017-01-20 22:09:21 +01:00
import { FingerprintAIO } from './plugins/fingerprint-aio' ;
2017-01-20 16:02:33 -05:00
import { Firebase } from './plugins/firebase' ;
2016-08-17 04:09:34 -03:00
import { Flashlight } from './plugins/flashlight' ;
2016-08-26 08:18:43 -04:00
import { Geofence } from './plugins/geofence' ;
2016-08-17 04:09:34 -03:00
import { Geolocation } from './plugins/geolocation' ;
import { Globalization } from './plugins/globalization' ;
import { GooglePlus } from './plugins/google-plus' ;
2016-10-27 07:17:14 -04:00
import { GoogleMap } from './plugins/googlemap' ;
2016-08-17 04:09:34 -03:00
import { GoogleAnalytics } from './plugins/googleanalytics' ;
2016-11-23 16:47:34 -03:00
import { HeaderColor } from './plugins/headercolor' ;
2016-08-17 04:09:34 -03:00
import { Hotspot } from './plugins/hotspot' ;
2016-10-11 07:25:15 -03:00
import { HTTP } from './plugins/http' ;
2016-08-17 04:09:34 -03:00
import { Httpd } from './plugins/httpd' ;
import { IBeacon } from './plugins/ibeacon' ;
import { ImagePicker } from './plugins/imagepicker' ;
import { ImageResizer } from './plugins/imageresizer' ;
import { InAppBrowser } from './plugins/inappbrowser' ;
2016-08-26 08:18:43 -04:00
import { InAppPurchase } from './plugins/inapppurchase' ;
2016-08-17 04:09:34 -03:00
import { Insomnia } from './plugins/insomnia' ;
2016-08-19 14:08:05 +01:00
import { Instagram } from './plugins/instagram' ;
2016-08-26 10:16:20 +01:00
import { IsDebug } from './plugins/is-debug' ;
2016-08-17 04:09:34 -03:00
import { Keyboard } from './plugins/keyboard' ;
import { LaunchNavigator } from './plugins/launchnavigator' ;
2017-01-20 22:11:57 +01:00
import { LaunchReview } from './plugins/launch-review' ;
2016-08-17 04:09:34 -03:00
import { LocalNotifications } from './plugins/localnotifications' ;
2016-09-25 18:28:22 -04:00
import { LocationAccuracy } from './plugins/location-accuracy' ;
2016-08-17 04:09:34 -03:00
import { MediaCapture } from './plugins/media-capture' ;
import { NativeAudio } from './plugins/native-audio' ;
2017-01-20 21:56:16 +01:00
import { NativeGeocoder } from './plugins/native-geocoder' ;
2016-08-27 02:02:13 -04:00
import { NativePageTransitions } from './plugins/native-page-transitions' ;
2016-08-17 04:09:34 -03:00
import { NativeStorage } from './plugins/nativestorage' ;
2017-01-20 18:04:31 -03:00
import { NavigationBar } from './plugins/navigationbar' ;
2016-08-27 02:02:30 -04:00
import { Market } from './plugins/market' ;
2016-08-17 04:09:34 -03:00
import { MediaPlugin } from './plugins/media' ;
2016-08-27 02:05:35 -04:00
import { Mixpanel } from './plugins/mixpanel' ;
2016-08-27 14:35:06 -04:00
import { MusicControls } from './plugins/music-controls' ;
2016-08-17 04:09:34 -03:00
import { Network } from './plugins/network' ;
2016-08-27 02:03:06 -04:00
import { NFC } from './plugins/nfc' ;
2016-08-17 04:09:34 -03:00
import { OneSignal } from './plugins/onesignal' ;
2016-08-11 07:28:52 -04:00
import { PhotoViewer } from './plugins/photo-viewer' ;
2016-08-17 04:09:34 -03:00
import { ScreenOrientation } from './plugins/screen-orientation' ;
2016-08-27 02:04:11 -04:00
import { PayPal } from './plugins/pay-pal' ;
2016-08-17 04:09:34 -03:00
import { PinDialog } from './plugins/pin-dialog' ;
2016-08-27 02:02:23 -04:00
import { PowerManagement } from './plugins/power-management' ;
2016-08-17 04:09:34 -03:00
import { Printer } from './plugins/printer' ;
import { Push } from './plugins/push' ;
2017-01-20 19:05:06 -02:00
import { Rollbar } from './plugins/rollbar' ;
2016-08-17 04:09:34 -03:00
import { SafariViewController } from './plugins/safari-view-controller' ;
import { Screenshot } from './plugins/screenshot' ;
import { SecureStorage } from './plugins/securestorage' ;
import { Shake } from './plugins/shake' ;
import { Sim } from './plugins/sim' ;
import { SMS } from './plugins/sms' ;
import { SocialSharing } from './plugins/socialsharing' ;
2017-01-20 22:13:58 +01:00
import { SpeechRecognition } from './plugins/speech-recognition' ;
2016-08-17 04:09:34 -03:00
import { SpinnerDialog } from './plugins/spinnerdialog' ;
import { Splashscreen } from './plugins/splashscreen' ;
import { SQLite } from './plugins/sqlite' ;
import { StatusBar } from './plugins/statusbar' ;
2016-10-03 00:20:01 +02:00
import { Stepcounter } from './plugins/stepcounter' ;
2016-08-27 02:01:59 -04:00
import { StreamingMedia } from './plugins/streaming-media' ;
2017-01-20 16:02:17 -05:00
import { Stripe } from './plugins/stripe' ;
2016-08-17 04:09:34 -03:00
import { ThreeDeeTouch } from './plugins/3dtouch' ;
import { Toast } from './plugins/toast' ;
import { TouchID } from './plugins/touchid' ;
import { TextToSpeech } from './plugins/text-to-speech' ;
2016-10-09 16:33:54 +08:00
import { ThemeableBrowser } from './plugins/themeable-browser' ;
2016-08-17 04:09:34 -03:00
import { TwitterConnect } from './plugins/twitter-connect' ;
import { Vibration } from './plugins/vibration' ;
2016-08-19 12:05:11 +01:00
import { VideoEditor } from './plugins/video-editor' ;
2016-08-17 04:09:34 -03:00
import { VideoPlayer } from './plugins/video-player' ;
import { WebIntent } from './plugins/webintent' ;
2016-08-27 14:35:18 -04:00
import { YoutubeVideoPlayer } from './plugins/youtube-video-player' ;
2016-10-04 21:12:39 +02:00
import { ZBar } from './plugins/z-bar' ;
2016-08-17 04:09:34 -03:00
import { Zip } from './plugins/zip' ;
2016-06-09 21:47:27 -04:00
export * from './plugins/3dtouch' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/actionsheet' ;
export * from './plugins/admob' ;
export * from './plugins/android-fingerprint-auth' ;
export * from './plugins/appavailability' ;
export * from './plugins/apprate' ;
export * from './plugins/appversion' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/background-geolocation' ;
export * from './plugins/backgroundmode' ;
2017-01-21 05:14:29 +08:00
export * from './plugins/backlight' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/badge' ;
export * from './plugins/barcodescanner' ;
export * from './plugins/base64togallery' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/batterystatus' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/ble' ;
export * from './plugins/bluetoothserial' ;
export * from './plugins/brightness' ;
2017-01-21 05:11:19 +08:00
export * from './plugins/broadcaster' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/calendar' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/call-number' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/camera' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/camera-preview' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/card-io' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/clipboard' ;
2016-08-26 11:06:26 -05:00
export * from './plugins/code-push' ;
2016-06-10 01:10:50 -04:00
export * from './plugins/contacts' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/crop' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/datepicker' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/dbmeter' ;
export * from './plugins/deeplinks' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/device' ;
2016-10-15 07:41:06 -07:00
export * from './plugins/device-feedback' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/deviceaccounts' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/devicemotion' ;
export * from './plugins/deviceorientation' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/diagnostic' ;
export * from './plugins/dialogs' ;
export * from './plugins/emailcomposer' ;
export * from './plugins/estimote-beacons' ;
2016-08-26 07:54:52 -04:00
export * from './plugins/facebook' ;
2016-08-11 07:21:02 -04:00
export * from './plugins/file' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/file-chooser' ;
export * from './plugins/file-opener' ;
2016-07-11 22:53:35 +02:00
export * from './plugins/filetransfer' ;
2017-01-20 16:02:33 -05:00
export * from './plugins/firebase' ;
2016-10-18 12:05:19 +02:00
export * from './plugins/filepath' ;
2017-01-20 22:09:21 +01:00
export * from './plugins/fingerprint-aio' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/flashlight' ;
export * from './plugins/geofence' ;
2016-08-06 16:20:38 +09:00
export * from './plugins/geolocation' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/globalization' ;
export * from './plugins/google-plus' ;
export * from './plugins/googleanalytics' ;
2016-10-27 07:17:14 -04:00
export * from './plugins/googlemap' ;
2016-11-23 16:47:34 -03:00
export * from './plugins/headercolor' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/hotspot' ;
2016-10-11 01:06:41 -07:00
export * from './plugins/http' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/httpd' ;
2016-07-11 15:52:51 -05:00
export * from './plugins/ibeacon' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/imagepicker' ;
2016-07-28 18:46:48 +02:00
export * from './plugins/imageresizer' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/inappbrowser' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/inapppurchase' ;
export * from './plugins/insomnia' ;
export * from './plugins/instagram' ;
export * from './plugins/is-debug' ;
export * from './plugins/keyboard' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/launchnavigator' ;
2017-01-20 22:11:57 +01:00
export * from './plugins/launch-review' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/localnotifications' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/location-accuracy' ;
export * from './plugins/market' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/media' ;
2016-07-17 02:07:59 -04:00
export * from './plugins/media-capture' ;
2016-08-27 02:05:35 -04:00
export * from './plugins/mixpanel' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/music-controls' ;
export * from './plugins/native-audio' ;
2017-01-20 21:56:16 +01:00
export * from './plugins/native-geocoder' ;
2016-08-27 02:02:13 -04:00
export * from './plugins/native-page-transitions' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/nativestorage' ;
2017-01-20 18:04:31 -03:00
export * from './plugins/navigationbar' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/network' ;
export * from './plugins/nfc' ;
export * from './plugins/onesignal' ;
export * from './plugins/pay-pal' ;
export * from './plugins/photo-viewer' ;
export * from './plugins/pin-dialog' ;
export * from './plugins/plugin' ;
export * from './plugins/power-management' ;
2016-06-15 11:39:01 -04:00
export * from './plugins/printer' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/push' ;
2017-01-20 19:05:06 -02:00
export * from './plugins/rollbar' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/safari-view-controller' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/screen-orientation' ;
export * from './plugins/screenshot' ;
export * from './plugins/securestorage' ;
export * from './plugins/shake' ;
export * from './plugins/sim' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/sms' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/socialsharing' ;
2017-01-20 22:13:58 +01:00
export * from './plugins/speech-recognition' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/spinnerdialog' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/splashscreen' ;
export * from './plugins/sqlite' ;
export * from './plugins/statusbar' ;
export * from './plugins/stepcounter' ;
2016-08-27 02:01:59 -04:00
export * from './plugins/streaming-media' ;
2017-01-20 16:02:17 -05:00
export * from './plugins/stripe' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/text-to-speech' ;
2016-10-09 16:33:54 +08:00
export * from './plugins/themeable-browser' ;
2016-06-11 00:45:05 -04:00
export * from './plugins/toast' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/touchid' ;
2016-07-23 07:01:02 -04:00
export * from './plugins/twitter-connect' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/vibration' ;
2016-08-19 12:05:11 +01:00
export * from './plugins/video-editor' ;
2016-08-04 23:57:44 +02:00
export * from './plugins/video-player' ;
2016-10-05 20:29:40 -04:00
export * from './plugins/webintent' ;
export * from './plugins/youtube-video-player' ;
export * from './plugins/z-bar' ;
export * from './plugins/zip' ;
2016-03-10 10:29:03 -06:00
2015-12-01 13:33:08 -06:00
// Window export to use outside of a module loading system
window [ 'IonicNative' ] = {
2016-08-19 08:34:12 +01:00
ActionSheet ,
AdMob ,
AndroidFingerprintAuth ,
AppAvailability ,
AppRate ,
AppVersion ,
Badge ,
BackgroundGeolocation ,
BackgroundMode ,
2017-01-21 05:14:29 +08:00
Backlight ,
2016-08-19 08:34:12 +01:00
BarcodeScanner ,
Base64ToGallery ,
BatteryStatus ,
Brightness ,
BLE ,
BluetoothSerial ,
2017-01-21 05:11:19 +08:00
Broadcaster ,
2016-08-19 08:34:12 +01:00
Calendar ,
2016-08-27 14:55:37 -04:00
CallNumber ,
2016-08-19 08:34:12 +01:00
Camera ,
CameraPreview ,
CardIO ,
Clipboard ,
2016-08-27 14:55:37 -04:00
CodePush ,
2016-08-19 08:34:12 +01:00
Contacts ,
Crop ,
DatePicker ,
DBMeter ,
Deeplinks ,
Device ,
2016-10-15 07:41:06 -07:00
DeviceFeedback ,
2016-08-19 08:34:12 +01:00
DeviceAccounts ,
DeviceMotion ,
DeviceOrientation ,
Dialogs ,
Diagnostic ,
EmailComposer ,
2016-08-27 14:55:37 -04:00
EstimoteBeacons ,
2016-08-19 08:34:12 +01:00
Facebook ,
File ,
2016-08-27 14:55:37 -04:00
FileChooser ,
FileOpener ,
2016-10-18 12:05:19 +02:00
FilePath ,
2017-01-20 22:09:21 +01:00
FingerprintAIO ,
2016-08-19 08:34:12 +01:00
Flashlight ,
2017-01-20 16:02:33 -05:00
Firebase ,
2016-08-27 14:55:37 -04:00
Geofence ,
2016-08-19 08:34:12 +01:00
Geolocation ,
Globalization ,
GooglePlus ,
GoogleMap ,
GoogleAnalytics ,
2016-11-23 16:47:34 -03:00
HeaderColor ,
2016-08-19 08:34:12 +01:00
Hotspot ,
2016-10-11 07:25:15 -03:00
HTTP ,
2016-08-19 08:34:12 +01:00
Httpd ,
IBeacon ,
ImagePicker ,
ImageResizer ,
InAppBrowser ,
2016-08-27 14:55:37 -04:00
InAppPurchase ,
2016-10-05 20:29:40 -04:00
Insomnia ,
2016-08-27 14:55:37 -04:00
Instagram ,
IsDebug ,
2016-08-19 08:34:12 +01:00
Keyboard ,
LaunchNavigator ,
2017-01-20 22:11:57 +01:00
LaunchReview ,
2016-08-19 08:34:12 +01:00
LocalNotifications ,
2016-09-25 18:28:22 -04:00
LocationAccuracy ,
2016-08-27 14:55:37 -04:00
Market ,
2016-08-19 08:34:12 +01:00
MediaCapture ,
MediaPlugin ,
2016-08-27 14:55:37 -04:00
Mixpanel ,
MusicControls ,
2016-08-19 08:34:12 +01:00
NativeAudio ,
2017-01-20 21:56:16 +01:00
NativeGeocoder ,
2016-08-27 14:55:37 -04:00
NativePageTransitions ,
2016-08-19 08:34:12 +01:00
NativeStorage ,
2017-01-20 18:04:31 -03:00
NavigationBar ,
2016-08-19 08:34:12 +01:00
Network ,
2016-08-27 14:55:37 -04:00
PayPal ,
NFC ,
2016-08-19 08:34:12 +01:00
Printer ,
Push ,
OneSignal ,
PhotoViewer ,
ScreenOrientation ,
PinDialog ,
2016-08-27 14:55:37 -04:00
PowerManagement ,
2017-01-20 19:05:06 -02:00
Rollbar ,
2016-08-19 08:34:12 +01:00
SafariViewController ,
Screenshot ,
SecureStorage ,
Shake ,
Sim ,
SMS ,
SocialSharing ,
SpinnerDialog ,
Splashscreen ,
SQLite ,
StatusBar ,
2017-01-20 22:13:58 +01:00
SpeechRecognition ,
2016-10-03 00:20:01 +02:00
Stepcounter ,
2016-08-27 14:55:37 -04:00
StreamingMedia ,
2017-01-20 16:02:17 -05:00
Stripe ,
2016-08-19 08:34:12 +01:00
ThreeDeeTouch ,
Toast ,
TouchID ,
Transfer ,
TextToSpeech ,
2016-10-09 16:33:54 +08:00
ThemeableBrowser ,
2016-08-19 08:34:12 +01:00
TwitterConnect ,
2016-08-27 14:55:37 -04:00
VideoEditor ,
2016-08-19 08:34:12 +01:00
VideoPlayer ,
Vibration ,
WebIntent ,
2016-08-27 14:55:37 -04:00
YoutubeVideoPlayer ,
2016-10-04 21:12:39 +02:00
ZBar ,
2016-08-19 08:34:12 +01:00
Zip
2016-03-06 15:27:26 -05:00
} ;
2015-12-01 13:33:08 -06:00
2016-06-09 11:24:38 -05:00
initAngular1 ( window [ 'IonicNative' ] ) ;
2015-11-29 17:20:11 -06: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.
2016-08-19 08:34:12 +01:00
const before = Date . now ( ) ;
2015-11-30 13:27:25 -06:00
2015-11-29 16:30:15 -06:00
let didFireReady = false ;
2016-08-19 08:34:12 +01:00
document . addEventListener ( 'deviceready' , ( ) = > {
console . log ( 'DEVICE READY FIRED AFTER' , ( Date . now ( ) - before ) , 'ms' ) ;
2015-11-29 16:30:15 -06:00
didFireReady = true ;
2016-03-06 15:27:26 -05:00
} ) ;
2015-11-29 16:30:15 -06:00
2016-08-19 08:34:12 +01:00
setTimeout ( ( ) = > {
2016-04-29 23:56:49 -04:00
if ( ! didFireReady && window . cordova ) {
2016-08-19 08:34:12 +01:00
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. ` ) ;
2015-11-29 16:30:15 -06:00
}
} , DEVICE_READY_TIMEOUT ) ;