Explorar el Código

changes in the start of the app. In this moment doesn't show anymore the home screen when start the app in remember mode

Jorge Baquero hace 7 años
padre
commit
03c647a39e

+ 1 - 0
config.xml Ver fichero

@@ -90,4 +90,5 @@
90 90
     <allow-navigation href="http://192.168.0.7:8100" />
91 91
     <plugin name="cordova-sqlite-storage" spec="^2.2.1" />
92 92
     <allow-navigation href="http://192.168.43.167:8100" />
93
+    <plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
93 94
 </widget>

+ 15 - 0
package-lock.json Ver fichero

@@ -106,6 +106,11 @@
106 106
       "resolved": "https://registry.npmjs.org/@ionic-native/launch-navigator/-/launch-navigator-4.6.0.tgz",
107 107
       "integrity": "sha512-4BO2r/E1rnar+H/KIPbzBDwfsgUOVduFDfcU9Jx/bkB31FRbZKeW268jBFzZlPxOrg+hazmjs0w11ibgItDP9w=="
108 108
     },
109
+    "@ionic-native/local-notifications": {
110
+      "version": "4.7.0",
111
+      "resolved": "https://registry.npmjs.org/@ionic-native/local-notifications/-/local-notifications-4.7.0.tgz",
112
+      "integrity": "sha512-OVXpxF+JcHMvz11oKCEbJRLr/dlWQy/0HQYJMTk18cdevXVjju4IPazuhqTpTTxIXjBvTLHfUKu7rBO1ZJ8JRw=="
113
+    },
109 114
     "@ionic-native/push": {
110 115
       "version": "4.7.0",
111 116
       "resolved": "https://registry.npmjs.org/@ionic-native/push/-/push-4.7.0.tgz",
@@ -1334,6 +1339,11 @@
1334 1339
       "resolved": "https://registry.npmjs.org/cordova-plugin-actionsheet/-/cordova-plugin-actionsheet-2.3.3.tgz",
1335 1340
       "integrity": "sha1-6SYbLQBKjaQHOI1g31NMFWxS/xE="
1336 1341
     },
1342
+    "cordova-plugin-badge": {
1343
+      "version": "0.8.7",
1344
+      "resolved": "https://registry.npmjs.org/cordova-plugin-badge/-/cordova-plugin-badge-0.8.7.tgz",
1345
+      "integrity": "sha512-s+s4yusKdeJ4sMPhQs4zR3lR2UuROzSy14GFAp00pTHPiBfCtxeINSUYAZYnpuO3RGx6PPlVCwSJpVG0IdM58g=="
1346
+    },
1337 1347
     "cordova-plugin-device": {
1338 1348
       "version": "2.0.1",
1339 1349
       "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.1.tgz",
@@ -1359,6 +1369,11 @@
1359 1369
       "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-1.1.16.tgz",
1360 1370
       "integrity": "sha512-57EW4qNkKyCfcVt0pH11s88Dvwdtgf2UkbAyPNk2+T1cmLVQ503S/+3Wa3l173J0NGt/QGGyUM8Z66LkqTnoWg=="
1361 1371
     },
1372
+    "cordova-plugin-local-notification": {
1373
+      "version": "0.9.0-beta.2",
1374
+      "resolved": "https://registry.npmjs.org/cordova-plugin-local-notification/-/cordova-plugin-local-notification-0.9.0-beta.2.tgz",
1375
+      "integrity": "sha512-63n77K1pt8dnbWnNR8QWETi9Glezi1bvNHvHWmGNIOv0xCb0phZnm+Ku49BQ+omwe8Z5voMvrA4I03SYPpv38w=="
1376
+    },
1362 1377
     "cordova-plugin-splashscreen": {
1363 1378
       "version": "5.0.2",
1364 1379
       "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",

+ 5 - 1
package.json Ver fichero

@@ -23,6 +23,7 @@
23 23
     "@ionic-native/core": "4.4.0",
24 24
     "@ionic-native/google-maps": "^4.5.3",
25 25
     "@ionic-native/launch-navigator": "^4.6.0",
26
+    "@ionic-native/local-notifications": "^4.7.0",
26 27
     "@ionic-native/push": "^4.7.0",
27 28
     "@ionic-native/social-sharing": "^4.6.0",
28 29
     "@ionic-native/splash-screen": "4.4.0",
@@ -30,11 +31,13 @@
30 31
     "@ionic/storage": "^2.1.3",
31 32
     "cordova-android": "7.0.0",
32 33
     "cordova-plugin-actionsheet": "^2.3.3",
34
+    "cordova-plugin-badge": "^0.8.7",
33 35
     "cordova-plugin-device": "^2.0.1",
34 36
     "cordova-plugin-dialogs": "^2.0.1",
35 37
     "cordova-plugin-googlemaps": "^2.2.5",
36 38
     "cordova-plugin-ionic-keyboard": "^2.0.5",
37 39
     "cordova-plugin-ionic-webview": "^1.1.16",
40
+    "cordova-plugin-local-notification": "^0.9.0-beta.2",
38 41
     "cordova-plugin-splashscreen": "^5.0.2",
39 42
     "cordova-plugin-whitelist": "^1.3.3",
40 43
     "cordova-sqlite-storage": "^2.2.1",
@@ -61,7 +64,8 @@
61 64
         "PLAY_SERVICES_VERSION": "11.8.0",
62 65
         "ANDROID_SUPPORT_V4_VERSION": "24.1.0"
63 66
       },
64
-      "cordova-sqlite-storage": {}
67
+      "cordova-sqlite-storage": {},
68
+      "cordova-plugin-local-notification": {}
65 69
     },
66 70
     "platforms": [
67 71
       "android"

+ 2 - 0
src/app/app.module.ts Ver fichero

@@ -13,6 +13,7 @@ import { Main } from '../pages/main/main';
13 13
 import { DevicesPage } from '../pages/devices/devices';
14 14
 import { ConfigurationPage } from '../pages/configuration/configuration';
15 15
 import { VespotServiceProvider } from '../providers/vespot-service/vespot-service';
16
+import { VespotNotificationProvider } from '../providers/vespot-notification/vespot-notification';
16 17
 import { ShareService } from '../services/share/share';
17 18
 
18 19
 @NgModule({
@@ -43,6 +44,7 @@ import { ShareService } from '../services/share/share';
43 44
     GoogleMaps,
44 45
     {provide: ErrorHandler, useClass: IonicErrorHandler},
45 46
     VespotServiceProvider,
47
+    VespotNotificationProvider,
46 48
     ShareService
47 49
   ]
48 50
 })

+ 12 - 1
src/pages/configuration/configuration.html Ver fichero

@@ -20,13 +20,24 @@
20 20
       <ion-toggle checked="false" [(ngModel)]="startAlarm" (ionChange)="changeAlarm()"></ion-toggle>
21 21
     </ion-item>
22 22
     <ion-item>
23
-      <ion-label>Tiempo Actualización</ion-label>
23
+      <ion-label>Actualización de mapa a los...</ion-label>
24 24
       <ion-select [(ngModel)]="time" (ionChange)="changeTime()">
25 25
         <ion-option value="15">15 seg</ion-option>
26 26
         <ion-option value="30" selected="true">30 seg</ion-option>
27 27
         <ion-option value="60">60 seg</ion-option>
28 28
       </ion-select>
29 29
     </ion-item>
30
+
31
+    <ion-item>
32
+      <ion-label>Alarma Activa a los...</ion-label>
33
+      <ion-select [(ngModel)]="activeAlarm" (ionChange)="changeActiveAlarm()">
34
+        <ion-option value="2">2 min</ion-option>
35
+        <ion-option value="5" selected="true">5 min</ion-option>
36
+        <ion-option value="10">10 min</ion-option>
37
+        <ion-option value="15">15 min</ion-option>
38
+      </ion-select>
39
+    </ion-item>
40
+
30 41
   </ion-list>
31 42
 
32 43
 </ion-content>

+ 5 - 0
src/pages/configuration/configuration.ts Ver fichero

@@ -18,6 +18,7 @@ export class ConfigurationPage {
18 18
 
19 19
   startAlarm: any;
20 20
   time: any;
21
+  activeAlarm: any;
21 22
 
22 23
   constructor(public navCtrl: NavController,
23 24
     public navParams: NavParams,
@@ -41,4 +42,8 @@ export class ConfigurationPage {
41 42
     this.storage.set('time', this.time);
42 43
   }
43 44
 
45
+  changeActiveAlarm() {
46
+    this.storage.set('activeAlarm', this.activeAlarm);
47
+  }
48
+
44 49
 }

+ 4 - 0
src/providers/vespot-service/vespot-service.ts Ver fichero

@@ -31,5 +31,9 @@ export class VespotServiceProvider {
31 31
 
32 32
   getPositionByDeviceId(auth, deviceId) {
33 33
     return this.http.get(this.URL + '/positions/lastdeviceposition?deviceId=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + auth)});
34
+  }
35
+
36
+	getDeviceLastEvent(auth, deviceId) {
37
+    return this.http.get(this.URL + '/events/lastevent?deviceId=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + auth)});
34 38
   }
35 39
 }