2 Commits 4e66dc0b61 ... 03c647a39e

Author SHA1 Message Date
  Jorge Baquero 03c647a39e changes in the start of the app. In this moment doesn't show anymore the home screen when start the app in remember mode 7 years ago
  Jorge Baquero f4ba96fd27 Changes in the initialization of the app 7 years ago

+ 1 - 2
config.xml View File

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-x-socialsharing" spec="^5.3.2" />
94
-    <plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^4.2.0" />
93
+    <plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
95
 </widget>
94
 </widget>

+ 20 - 15
package-lock.json View File

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
+    },
114
+    "@ionic-native/push": {
115
+      "version": "4.7.0",
116
+      "resolved": "https://registry.npmjs.org/@ionic-native/push/-/push-4.7.0.tgz",
117
+      "integrity": "sha512-ynucoNm2Kg30rYAdgOv0h9oGGjVLz+AugL7O1/ng5piMFhC46O/eIUDJPTwkPqyM1USR/d99zbosttRo9aNgLg=="
118
+    },
109
     "@ionic-native/social-sharing": {
119
     "@ionic-native/social-sharing": {
110
       "version": "4.6.0",
120
       "version": "4.6.0",
111
       "resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-4.6.0.tgz",
121
       "resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-4.6.0.tgz",
1329
       "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",
1330
       "integrity": "sha1-6SYbLQBKjaQHOI1g31NMFWxS/xE="
1340
       "integrity": "sha1-6SYbLQBKjaQHOI1g31NMFWxS/xE="
1331
     },
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
+    },
1332
     "cordova-plugin-device": {
1347
     "cordova-plugin-device": {
1333
       "version": "2.0.1",
1348
       "version": "2.0.1",
1334
       "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",
1354
       "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",
1355
       "integrity": "sha512-57EW4qNkKyCfcVt0pH11s88Dvwdtgf2UkbAyPNk2+T1cmLVQ503S/+3Wa3l173J0NGt/QGGyUM8Z66LkqTnoWg=="
1370
       "integrity": "sha512-57EW4qNkKyCfcVt0pH11s88Dvwdtgf2UkbAyPNk2+T1cmLVQ503S/+3Wa3l173J0NGt/QGGyUM8Z66LkqTnoWg=="
1356
     },
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
+    },
1357
     "cordova-plugin-splashscreen": {
1377
     "cordova-plugin-splashscreen": {
1358
       "version": "5.0.2",
1378
       "version": "5.0.2",
1359
       "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",
1364
       "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz",
1384
       "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz",
1365
       "integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q="
1385
       "integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q="
1366
     },
1386
     },
1367
-    "cordova-plugin-x-socialsharing": {
1368
-      "version": "5.3.2",
1369
-      "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-5.3.2.tgz",
1370
-      "integrity": "sha1-8SBYny+lB+kqMG8lypV7lvmWhrE="
1371
-    },
1372
     "cordova-sqlite-storage": {
1387
     "cordova-sqlite-storage": {
1373
       "version": "2.2.1",
1388
       "version": "2.2.1",
1374
       "resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-2.2.1.tgz",
1389
       "resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-2.2.1.tgz",
1757
         "event-emitter": "0.3.5"
1772
         "event-emitter": "0.3.5"
1758
       }
1773
       }
1759
     },
1774
     },
1760
-    "es6-promise-plugin": {
1761
-      "version": "4.2.2",
1762
-      "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
1763
-      "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA=="
1764
-    },
1765
     "es6-set": {
1775
     "es6-set": {
1766
       "version": "0.1.5",
1776
       "version": "0.1.5",
1767
       "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
1777
       "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
6264
         }
6274
         }
6265
       }
6275
       }
6266
     },
6276
     },
6267
-    "uk.co.workingedge.phonegap.plugin.launchnavigator": {
6268
-      "version": "4.2.0",
6269
-      "resolved": "https://registry.npmjs.org/uk.co.workingedge.phonegap.plugin.launchnavigator/-/uk.co.workingedge.phonegap.plugin.launchnavigator-4.2.0.tgz",
6270
-      "integrity": "sha1-B7NHCzOpwUAVivRigpauIkw0YaU="
6271
-    },
6272
     "ultron": {
6277
     "ultron": {
6273
       "version": "1.1.1",
6278
       "version": "1.1.1",
6274
       "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
6279
       "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",

+ 5 - 5
package.json View File

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",
27
+    "@ionic-native/push": "^4.7.0",
26
     "@ionic-native/social-sharing": "^4.6.0",
28
     "@ionic-native/social-sharing": "^4.6.0",
27
     "@ionic-native/splash-screen": "4.4.0",
29
     "@ionic-native/splash-screen": "4.4.0",
28
     "@ionic-native/status-bar": "4.4.0",
30
     "@ionic-native/status-bar": "4.4.0",
29
     "@ionic/storage": "^2.1.3",
31
     "@ionic/storage": "^2.1.3",
30
     "cordova-android": "7.0.0",
32
     "cordova-android": "7.0.0",
31
     "cordova-plugin-actionsheet": "^2.3.3",
33
     "cordova-plugin-actionsheet": "^2.3.3",
34
+    "cordova-plugin-badge": "^0.8.7",
32
     "cordova-plugin-device": "^2.0.1",
35
     "cordova-plugin-device": "^2.0.1",
33
     "cordova-plugin-dialogs": "^2.0.1",
36
     "cordova-plugin-dialogs": "^2.0.1",
34
     "cordova-plugin-googlemaps": "^2.2.5",
37
     "cordova-plugin-googlemaps": "^2.2.5",
35
     "cordova-plugin-ionic-keyboard": "^2.0.5",
38
     "cordova-plugin-ionic-keyboard": "^2.0.5",
36
     "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",
37
     "cordova-plugin-splashscreen": "^5.0.2",
41
     "cordova-plugin-splashscreen": "^5.0.2",
38
     "cordova-plugin-whitelist": "^1.3.3",
42
     "cordova-plugin-whitelist": "^1.3.3",
39
-    "cordova-plugin-x-socialsharing": "^5.3.2",
40
     "cordova-sqlite-storage": "^2.2.1",
43
     "cordova-sqlite-storage": "^2.2.1",
41
-    "es6-promise-plugin": "^4.2.2",
42
     "ionic-angular": "3.9.2",
44
     "ionic-angular": "3.9.2",
43
     "ionicons": "3.0.0",
45
     "ionicons": "3.0.0",
44
     "rxjs": "5.5.2",
46
     "rxjs": "5.5.2",
45
     "sw-toolbox": "3.6.0",
47
     "sw-toolbox": "3.6.0",
46
-    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.2.0",
47
     "zone.js": "0.8.18"
48
     "zone.js": "0.8.18"
48
   },
49
   },
49
   "devDependencies": {
50
   "devDependencies": {
64
         "ANDROID_SUPPORT_V4_VERSION": "24.1.0"
65
         "ANDROID_SUPPORT_V4_VERSION": "24.1.0"
65
       },
66
       },
66
       "cordova-sqlite-storage": {},
67
       "cordova-sqlite-storage": {},
67
-      "cordova-plugin-x-socialsharing": {},
68
-      "uk.co.workingedge.phonegap.plugin.launchnavigator": {}
68
+      "cordova-plugin-local-notification": {}
69
     },
69
     },
70
     "platforms": [
70
     "platforms": [
71
       "android"
71
       "android"

+ 33 - 3
src/app/app.component.ts View File

3
 import { StatusBar } from '@ionic-native/status-bar';
3
 import { StatusBar } from '@ionic-native/status-bar';
4
 import { SplashScreen } from '@ionic-native/splash-screen';
4
 import { SplashScreen } from '@ionic-native/splash-screen';
5
 import { Storage } from '@ionic/storage';
5
 import { Storage } from '@ionic/storage';
6
+import { VespotServiceProvider } from '../providers/vespot-service/vespot-service';
7
+import { ShareService } from '../services/share/share';
6
 
8
 
7
 import { HomePage } from '../pages/home/home';
9
 import { HomePage } from '../pages/home/home';
8
 import { DevicesPage } from '../pages/devices/devices';
10
 import { DevicesPage } from '../pages/devices/devices';
11
+import { Main } from '../pages/main/main';
9
 import { ConfigurationPage } from '../pages/configuration/configuration';
12
 import { ConfigurationPage } from '../pages/configuration/configuration';
10
 
13
 
11
 @Component({
14
 @Component({
13
 })
16
 })
14
 export class MyApp {
17
 export class MyApp {
15
   @ViewChild(Nav) nav: Nav;
18
   @ViewChild(Nav) nav: Nav;
16
-  rootPage:any = HomePage;
19
+  //rootPage:any = HomePage;
17
 
20
 
18
-  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,
21
+  constructor(platform: Platform,
22
+    statusBar: StatusBar,
23
+    splashScreen: SplashScreen,
19
     private alertCtrl: AlertController,
24
     private alertCtrl: AlertController,
20
-  private storage: Storage) {
25
+  private storage: Storage,
26
+  public vespotService: VespotServiceProvider,
27
+  public shareService: ShareService) {
21
     /*platform.ready().then(() => {
28
     /*platform.ready().then(() => {
22
       // Okay, so the platform is ready and our plugins are available.
29
       // Okay, so the platform is ready and our plugins are available.
23
       // Here you can do any higher level native things you might need.
30
       // Here you can do any higher level native things you might need.
24
       statusBar.styleDefault();
31
       statusBar.styleDefault();
25
       splashScreen.hide();
32
       splashScreen.hide();
26
     });*/
33
     });*/
34
+    this.storage.get('remember').then((val)=>{
35
+        if(val) {
36
+          this.storage.get('authentication').then((valAuth)=>{
37
+              this.authenticateUser(valAuth);
38
+          });
39
+        } else {
40
+              this.nav.setRoot(HomePage);
41
+        }
42
+    });
43
+  }
44
+
45
+  authenticateUser(auth) {
46
+    this.vespotService.getDevices(auth)
47
+  	.subscribe(
48
+        (data) => { // Success
49
+          this.shareService.setDevices(data);
50
+          this.shareService.setAuthToken(auth);
51
+          this.nav.setRoot(Main);
52
+        },
53
+        (error) =>{
54
+          this.nav.setRoot(HomePage);
55
+        }
56
+      );
27
   }
57
   }
28
 
58
 
29
   openDevicesPage() {
59
   openDevicesPage() {

+ 3 - 5
src/app/app.module.ts View File

6
 import { HttpClientModule } from '@angular/common/http';
6
 import { HttpClientModule } from '@angular/common/http';
7
 import { GoogleMaps } from '@ionic-native/google-maps';
7
 import { GoogleMaps } from '@ionic-native/google-maps';
8
 import { IonicStorageModule } from '@ionic/storage';
8
 import { IonicStorageModule } from '@ionic/storage';
9
-import { LaunchNavigator, LaunchNavigatorOptions } from '@ionic-native/launch-navigator';
10
-import { SocialSharing } from '@ionic-native/social-sharing';
11
 
9
 
12
 import { MyApp } from './app.component';
10
 import { MyApp } from './app.component';
13
 import { HomePage } from '../pages/home/home';
11
 import { HomePage } from '../pages/home/home';
15
 import { DevicesPage } from '../pages/devices/devices';
13
 import { DevicesPage } from '../pages/devices/devices';
16
 import { ConfigurationPage } from '../pages/configuration/configuration';
14
 import { ConfigurationPage } from '../pages/configuration/configuration';
17
 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';
18
 import { ShareService } from '../services/share/share';
17
 import { ShareService } from '../services/share/share';
19
 
18
 
20
 @NgModule({
19
 @NgModule({
45
     GoogleMaps,
44
     GoogleMaps,
46
     {provide: ErrorHandler, useClass: IonicErrorHandler},
45
     {provide: ErrorHandler, useClass: IonicErrorHandler},
47
     VespotServiceProvider,
46
     VespotServiceProvider,
48
-    ShareService,
49
-    LaunchNavigator,
50
-    SocialSharing
47
+    VespotNotificationProvider,
48
+    ShareService
51
   ]
49
   ]
52
 })
50
 })
53
 export class AppModule {}
51
 export class AppModule {}

+ 12 - 1
src/pages/configuration/configuration.html View File

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 View File

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
 }

+ 2 - 2
src/pages/home/home.ts View File

21
 		public vespotService: VespotServiceProvider,
21
 		public vespotService: VespotServiceProvider,
22
     public shareService: ShareService,
22
     public shareService: ShareService,
23
     private storage: Storage) {
23
     private storage: Storage) {
24
-      this.storage.get('remember').then((val)=>{
24
+      /*this.storage.get('remember').then((val)=>{
25
           if(val) {
25
           if(val) {
26
             this.storage.get('authentication').then((valAuth)=>{
26
             this.storage.get('authentication').then((valAuth)=>{
27
                 this.authenticateUser(valAuth);
27
                 this.authenticateUser(valAuth);
28
             });
28
             });
29
           }
29
           }
30
-      });
30
+      });*/
31
   }
31
   }
32
 
32
 
33
   /*ionViewCanEnter() {
33
   /*ionViewCanEnter() {

+ 1 - 5
src/pages/main/main.html View File

10
 <ion-content padding>
10
 <ion-content padding>
11
   <div id="map_canvas">
11
   <div id="map_canvas">
12
     <ion-fab right bottom>
12
     <ion-fab right bottom>
13
-      <button ion-fab color="primary"><ion-icon name="car"></ion-icon></button>
14
-      <ion-fab-list side="left">
15
-        <button ion-fab><ion-icon name="map" (click)="shareViaMaps()"></ion-icon></button>
16
-        <button ion-fab><ion-icon name="logo-whatsapp" (click)="shareViaWhatsapp()"></ion-icon></button>
17
-      </ion-fab-list>
13
+      <button ion-fab color="primary" (click)="getPosition()"><ion-icon name="car"></ion-icon></button>
18
     </ion-fab>-
14
     </ion-fab>-
19
   </div>
15
   </div>
20
 </ion-content>
16
 </ion-content>

+ 1 - 24
src/pages/main/main.ts View File

3
 import { AlertController } from 'ionic-angular';
3
 import { AlertController } from 'ionic-angular';
4
 import { interval } from 'rxjs/observable/interval';
4
 import { interval } from 'rxjs/observable/interval';
5
 import { Storage } from '@ionic/storage';
5
 import { Storage } from '@ionic/storage';
6
-import { LaunchNavigator, LaunchNavigatorOptions } from '@ionic-native/launch-navigator';
7
-import { SocialSharing } from '@ionic-native/social-sharing';
8
 
6
 
9
 import { DevicesPage } from '../devices/devices'
7
 import { DevicesPage } from '../devices/devices'
10
 import { ConfigurationPage } from '../configuration/configuration'
8
 import { ConfigurationPage } from '../configuration/configuration'
40
   private googleMaps: GoogleMaps,
38
   private googleMaps: GoogleMaps,
41
   private vespotService: VespotServiceProvider,
39
   private vespotService: VespotServiceProvider,
42
   public alertCtrl: AlertController,
40
   public alertCtrl: AlertController,
43
-  private storage: Storage,
44
-  private launchNavigator: LaunchNavigator,
45
-  private socialSharing: SocialSharing) {
41
+  private storage: Storage) {
46
       this.devicesPage = DevicesPage;
42
       this.devicesPage = DevicesPage;
47
       this.configurationPage = ConfigurationPage;
43
       this.configurationPage = ConfigurationPage;
48
       this.devices = this.shareService.getDevices();
44
       this.devices = this.shareService.getDevices();
51
 
47
 
52
   }
48
   }
53
 
49
 
54
-
55
-
56
   ionViewWillEnter() {
50
   ionViewWillEnter() {
57
     if(typeof this.shareService.getRootDevice() == "undefined") {
51
     if(typeof this.shareService.getRootDevice() == "undefined") {
58
       console.log('ionViewWillEnter: Entro al undefined');
52
       console.log('ionViewWillEnter: Entro al undefined');
175
         );
169
         );
176
   }
170
   }
177
 
171
 
178
-  shareViaMaps() {
179
-    let options: LaunchNavigatorOptions = {
180
-      start: 'Bogota, ON'
181
-    };
182
-
183
-    this.launchNavigator.navigate([this.rootPosition.latitude, this.rootPosition.longitude], options)
184
-    .then(
185
-      success => console.log('Launched navigator'),
186
-      error => console.log('Error launching navigator', error)
187
-    );
188
-  }
189
-
190
-  shareViaWhatsarpp() {
191
-    //http://maps.google.com/maps?&z={INSERT_MAP_ZOOM}&mrt={INSERT_TYPE_OF_SEARCH}&t={INSERT_MAP_TYPE}&q={INSERT_MAP_LAT_COORDINATES}+{INSERT_MAP_LONG_COORDINATES}
192
-    this.socialSharing.share('Posición de mi dispositivo', '', null, 'http://maps.google.com/maps?&z=15&mrt=yp&t=k&q=27.9879012+86.9253141')
193
-  }
194
-
195
 }
172
 }

+ 4 - 0
src/providers/vespot-service/vespot-service.ts View File

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
 }