Parcourir la source

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 il y a 7 ans
Parent
révision
03c647a39e

+ 1 - 0
config.xml Voir le fichier

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

+ 15 - 0
package-lock.json Voir le fichier

106
       "resolved": "https://registry.npmjs.org/@ionic-native/launch-navigator/-/launch-navigator-4.6.0.tgz",
106
       "resolved": "https://registry.npmjs.org/@ionic-native/launch-navigator/-/launch-navigator-4.6.0.tgz",
107
       "integrity": "sha512-4BO2r/E1rnar+H/KIPbzBDwfsgUOVduFDfcU9Jx/bkB31FRbZKeW268jBFzZlPxOrg+hazmjs0w11ibgItDP9w=="
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
     "@ionic-native/push": {
114
     "@ionic-native/push": {
110
       "version": "4.7.0",
115
       "version": "4.7.0",
111
       "resolved": "https://registry.npmjs.org/@ionic-native/push/-/push-4.7.0.tgz",
116
       "resolved": "https://registry.npmjs.org/@ionic-native/push/-/push-4.7.0.tgz",
1334
       "resolved": "https://registry.npmjs.org/cordova-plugin-actionsheet/-/cordova-plugin-actionsheet-2.3.3.tgz",
1339
       "resolved": "https://registry.npmjs.org/cordova-plugin-actionsheet/-/cordova-plugin-actionsheet-2.3.3.tgz",
1335
       "integrity": "sha1-6SYbLQBKjaQHOI1g31NMFWxS/xE="
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
     "cordova-plugin-device": {
1347
     "cordova-plugin-device": {
1338
       "version": "2.0.1",
1348
       "version": "2.0.1",
1339
       "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.1.tgz",
1349
       "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.1.tgz",
1359
       "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-1.1.16.tgz",
1369
       "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-1.1.16.tgz",
1360
       "integrity": "sha512-57EW4qNkKyCfcVt0pH11s88Dvwdtgf2UkbAyPNk2+T1cmLVQ503S/+3Wa3l173J0NGt/QGGyUM8Z66LkqTnoWg=="
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
     "cordova-plugin-splashscreen": {
1377
     "cordova-plugin-splashscreen": {
1363
       "version": "5.0.2",
1378
       "version": "5.0.2",
1364
       "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",
1379
       "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",

+ 5 - 1
package.json Voir le fichier

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

+ 2 - 0
src/app/app.module.ts Voir le fichier

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

+ 12 - 1
src/pages/configuration/configuration.html Voir le fichier

20
       <ion-toggle checked="false" [(ngModel)]="startAlarm" (ionChange)="changeAlarm()"></ion-toggle>
20
       <ion-toggle checked="false" [(ngModel)]="startAlarm" (ionChange)="changeAlarm()"></ion-toggle>
21
     </ion-item>
21
     </ion-item>
22
     <ion-item>
22
     <ion-item>
23
-      <ion-label>Tiempo Actualización</ion-label>
23
+      <ion-label>Actualización de mapa a los...</ion-label>
24
       <ion-select [(ngModel)]="time" (ionChange)="changeTime()">
24
       <ion-select [(ngModel)]="time" (ionChange)="changeTime()">
25
         <ion-option value="15">15 seg</ion-option>
25
         <ion-option value="15">15 seg</ion-option>
26
         <ion-option value="30" selected="true">30 seg</ion-option>
26
         <ion-option value="30" selected="true">30 seg</ion-option>
27
         <ion-option value="60">60 seg</ion-option>
27
         <ion-option value="60">60 seg</ion-option>
28
       </ion-select>
28
       </ion-select>
29
     </ion-item>
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
   </ion-list>
41
   </ion-list>
31
 
42
 
32
 </ion-content>
43
 </ion-content>

+ 5 - 0
src/pages/configuration/configuration.ts Voir le fichier

18
 
18
 
19
   startAlarm: any;
19
   startAlarm: any;
20
   time: any;
20
   time: any;
21
+  activeAlarm: any;
21
 
22
 
22
   constructor(public navCtrl: NavController,
23
   constructor(public navCtrl: NavController,
23
     public navParams: NavParams,
24
     public navParams: NavParams,
41
     this.storage.set('time', this.time);
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 Voir le fichier

31
 
31
 
32
   getPositionByDeviceId(auth, deviceId) {
32
   getPositionByDeviceId(auth, deviceId) {
33
     return this.http.get(this.URL + '/positions/lastdeviceposition?deviceId=' + deviceId, {headers: new HttpHeaders().set('Authorization', 'Basic ' + auth)});
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
 }