From 0c6d8ce1751978a65cde15ac20db5078d769ad8d Mon Sep 17 00:00:00 2001 From: Von Hirsch Date: Wed, 21 Mar 2018 17:34:16 -0400 Subject: [PATCH] Updates to project for Ionic3 --- config.xml | 176 +++++++++--------- ionic.config.json | 6 +- package.json | 71 ++++--- src/app/app.component.ts | 2 +- src/app/app.module.ts | 7 + src/index.html | 9 +- src/pages/geofence-list/geofence-list.ts | 11 +- tsconfig.json | 3 +- .../cordova-plugin-geofence/index.d.ts | 6 +- 9 files changed, 164 insertions(+), 127 deletions(-) mode change 100644 => 100755 package.json diff --git a/config.xml b/config.xml index aae7a21..2c9d059 100644 --- a/config.xml +++ b/config.xml @@ -1,91 +1,85 @@ - - - Ionic2 Geofence - Sample Cordova Geofence Application Built With Ionic 2 - Tomasz Subik - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + ionic2-geofence + An awesome Ionic/Cordova app. + Ionic Framework Team + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ionic.config.json b/ionic.config.json index 7517125..3cf02ba 100644 --- a/ionic.config.json +++ b/ionic.config.json @@ -1,6 +1,8 @@ { "name": "ionic2-geofence", "app_id": "", - "v2": true, - "typescript": true + "type": "ionic-angular", + "integrations": { + "cordova": {} + } } diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 1644854..0d988e0 --- a/package.json +++ b/package.json @@ -1,39 +1,62 @@ { "name": "ionic2-geofence", - "description": "ionic2-geofence: An Ionic project", + "version": "0.0.1", + "author": "Ionic Framework", + "homepage": "http://ionicframework.com/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", + "lint": "ionic-app-scripts lint", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { - "@angular/common": "2.2.1", - "@angular/compiler": "2.2.1", - "@angular/compiler-cli": "2.2.1", - "@angular/core": "2.2.1", - "@angular/forms": "2.2.1", - "@angular/http": "2.2.1", - "@angular/platform-browser": "2.2.1", - "@angular/platform-browser-dynamic": "2.2.1", - "@angular/platform-server": "2.2.1", - "@ionic/storage": "1.1.7", - "@types/leaflet": "^1.0.54", - "ionic-angular": "2.0.1", - "ionic-native": "2.4.1", + "@angular/animations": "^5.2.9", + "@angular/common": "5.2.9", + "@angular/compiler": "5.2.9", + "@angular/compiler-cli": "5.2.9", + "@angular/core": "5.2.9", + "@angular/forms": "5.2.9", + "@angular/http": "5.2.9", + "@angular/platform-browser": "5.2.9", + "@angular/platform-browser-dynamic": "5.2.9", + "@ionic-native/core": "4.5.3", + "@ionic-native/geofence": "^4.6.0", + "@ionic-native/geolocation": "^4.6.0", + "@ionic-native/splash-screen": "4.5.3", + "@ionic-native/status-bar": "4.5.3", + "@ionic/storage": "^2.1.3", + "@types/leaflet": "^1.2.6", + "cordova-android": "7.0.0", + "cordova-plugin-device": "^2.0.1", + "cordova-plugin-ionic-keyboard": "^2.0.5", + "cordova-plugin-ionic-webview": "^1.1.16", + "cordova-plugin-splashscreen": "^5.0.2", + "cordova-plugin-whitelist": "^1.3.3", + "ionic-angular": "3.9.2", "ionicons": "3.0.0", - "leaflet": "^1.0.3", - "rxjs": "5.0.0-beta.12", - "sw-toolbox": "3.4.0", - "zone.js": "0.6.26" + "leaflet": "^1.3.1", + "rxjs": "5.5.7", + "sw-toolbox": "3.6.0", + "typings": "^2.1.1", + "zone.js": "0.8.20" }, "devDependencies": { - "@ionic/app-scripts": "1.0.0", - "cordova": "^6.5.0", - "typescript": "2.0.9", - "typings": "^2.1.0" + "@ionic/app-scripts": "3.1.8", + "typescript": "~2.6.2" }, - "cordovaPlugins": [], - "cordovaPlatforms": [] + "description": "An Ionic project", + "cordova": { + "plugins": { + "cordova-plugin-whitelist": {}, + "cordova-plugin-device": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-ionic-webview": {}, + "cordova-plugin-ionic-keyboard": {} + }, + "platforms": [ + "android" + ] + } } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b925182..53d66a0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,6 @@ import { Component, ViewChild } from "@angular/core"; import { Nav, Platform, AlertController, MenuController } from "ionic-angular"; -import * as Leaflet from "leaflet"; +import Leaflet from 'leaflet'; import { GeofenceListPage } from "../pages/geofence-list/geofence-list"; import { GeofenceService } from "../services/geofence-service"; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c53ec9c..2064ebb 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,3 +1,7 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { SplashScreen } from '@ionic-native/splash-screen'; +import { StatusBar } from '@ionic-native/status-bar'; + import { NgModule, ErrorHandler } from "@angular/core"; import { IonicApp, IonicModule, IonicErrorHandler } from "ionic-angular"; @@ -17,11 +21,14 @@ const components = [ @NgModule({ declarations: components, imports: [ + BrowserModule, IonicModule.forRoot(MyApp) ], bootstrap: [IonicApp], entryComponents: components, providers: [ + StatusBar, + SplashScreen, {provide: ErrorHandler, useClass: IonicErrorHandler}, GeofenceService ] diff --git a/src/index.html b/src/index.html index 4b69d7a..09f3401 100644 --- a/src/index.html +++ b/src/index.html @@ -17,13 +17,18 @@ - + - + + + + + diff --git a/src/pages/geofence-list/geofence-list.ts b/src/pages/geofence-list/geofence-list.ts index 179789a..688658b 100644 --- a/src/pages/geofence-list/geofence-list.ts +++ b/src/pages/geofence-list/geofence-list.ts @@ -2,7 +2,9 @@ import { Component } from "@angular/core"; import { NavController, Platform, MenuController } from "ionic-angular"; import { GeofenceDetailsPage } from "../geofence-details/geofence-details"; import { GeofenceService } from "../../services/geofence-service"; -import { Splashscreen } from "ionic-native"; + +import { StatusBar } from '@ionic-native/status-bar'; +import { SplashScreen } from '@ionic-native/splash-screen'; @Component({ templateUrl: "geofence-list.html" @@ -15,7 +17,9 @@ export class GeofenceListPage { private nav: NavController, private geofenceService: GeofenceService, private platform: Platform, - private menu: MenuController + private menu: MenuController, + private statusBar: StatusBar, + private splashScreen: SplashScreen ) { this.isLoading = true; this.platform.ready().then(() => { @@ -34,7 +38,8 @@ export class GeofenceListPage { ionViewDidLoad() { this.platform.ready().then(() => { - Splashscreen.hide(); + this.statusBar.styleDefault(); + this.splashScreen.hide(); }); } diff --git a/tsconfig.json b/tsconfig.json index e135955..4af49e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "experimentalDecorators": true, "lib": [ "dom", - "es2015" + "es2015", + "es6" ], "module": "es2015", "moduleResolution": "node", diff --git a/typings/globals/cordova-plugin-geofence/index.d.ts b/typings/globals/cordova-plugin-geofence/index.d.ts index 80a4df6..078330c 100644 --- a/typings/globals/cordova-plugin-geofence/index.d.ts +++ b/typings/globals/cordova-plugin-geofence/index.d.ts @@ -49,15 +49,15 @@ interface Geofence { longitude: number; radius: number; transitionType: number; - notification?: Notification; + notification?: Notification2; } -interface Notification { +interface Notification2 { id?: number; title?: string; text: string; smallIcon?: string; - icon?: string; + readonly icon?: string; openAppOnClick?: boolean; vibration?: number[]; data?: Object;