Browse Source

added cordova and ionic native plugins for geolocation

Kris Blassingame 6 years ago
parent
commit
851b2c00df

+ 6
- 0
frontEnd/config.xml View File

81
     <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
81
     <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
82
     <plugin name="cordova-plugin-ionic-webview" spec="1.1.19" />
82
     <plugin name="cordova-plugin-ionic-webview" spec="1.1.19" />
83
     <plugin name="cordova-plugin-ionic-keyboard" spec="2.0.5" />
83
     <plugin name="cordova-plugin-ionic-keyboard" spec="2.0.5" />
84
+    <plugin name="cordova-plugin-geolocation" spec="^4.0.1">
85
+        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To locate you" />
86
+    </plugin>
87
+    <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
88
+   <string>We want your location! Best regards NSA</string>
89
+</edit-config>
84
 </widget>
90
 </widget>

+ 10
- 0
frontEnd/package-lock.json View File

104
       "resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-4.9.2.tgz",
104
       "resolved": "https://registry.npmjs.org/@ionic-native/core/-/core-4.9.2.tgz",
105
       "integrity": "sha512-dWV08EjK82KCDU9CM4UVEZ5yrNj9Uz7GoL818MHeJfDS4uBZT+U7qqcHEklc3+R+lMLBuTnoWe+TX3O5SwmW9A=="
105
       "integrity": "sha512-dWV08EjK82KCDU9CM4UVEZ5yrNj9Uz7GoL818MHeJfDS4uBZT+U7qqcHEklc3+R+lMLBuTnoWe+TX3O5SwmW9A=="
106
     },
106
     },
107
+    "@ionic-native/geolocation": {
108
+      "version": "4.10.1",
109
+      "resolved": "https://registry.npmjs.org/@ionic-native/geolocation/-/geolocation-4.10.1.tgz",
110
+      "integrity": "sha512-ez5cYHxpsdeDn5DhGhKmOIR/ohT1wTGhAZTIzK9RU+1ZAMgK0q2m10eDTa/Xs/VCW5BNdrSWnLjMPteTNR8ozw=="
111
+    },
107
     "@ionic-native/splash-screen": {
112
     "@ionic-native/splash-screen": {
108
       "version": "4.9.2",
113
       "version": "4.9.2",
109
       "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-4.9.2.tgz",
114
       "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-4.9.2.tgz",
1117
       "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
1122
       "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
1118
       "dev": true
1123
       "dev": true
1119
     },
1124
     },
1125
+    "cordova-plugin-geolocation": {
1126
+      "version": "4.0.1",
1127
+      "resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-4.0.1.tgz",
1128
+      "integrity": "sha1-RwP6ZJ0kBdJamnMsmev4aHVKLAQ="
1129
+    },
1120
     "core-util-is": {
1130
     "core-util-is": {
1121
       "version": "1.0.2",
1131
       "version": "1.0.2",
1122
       "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
1132
       "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",

+ 10
- 1
frontEnd/package.json View File

21
     "@angular/platform-browser": "5.2.11",
21
     "@angular/platform-browser": "5.2.11",
22
     "@angular/platform-browser-dynamic": "5.2.11",
22
     "@angular/platform-browser-dynamic": "5.2.11",
23
     "@ionic-native/core": "~4.9.2",
23
     "@ionic-native/core": "~4.9.2",
24
+    "@ionic-native/geolocation": "^4.10.1",
24
     "@ionic-native/splash-screen": "~4.9.2",
25
     "@ionic-native/splash-screen": "~4.9.2",
25
     "@ionic-native/status-bar": "~4.9.2",
26
     "@ionic-native/status-bar": "~4.9.2",
26
     "@ionic/storage": "2.1.3",
27
     "@ionic/storage": "2.1.3",
27
     "@types/google-maps": "^3.2.0",
28
     "@types/google-maps": "^3.2.0",
29
+    "cordova-plugin-geolocation": "^4.0.1",
28
     "ionic-angular": "3.9.2",
30
     "ionic-angular": "3.9.2",
29
     "ionicons": "3.0.0",
31
     "ionicons": "3.0.0",
30
     "rxjs": "5.5.11",
32
     "rxjs": "5.5.11",
35
     "@ionic/app-scripts": "3.1.11",
37
     "@ionic/app-scripts": "3.1.11",
36
     "typescript": "~2.6.2"
38
     "typescript": "~2.6.2"
37
   },
39
   },
38
-  "description": "An Ionic project"
40
+  "description": "An Ionic project",
41
+  "cordova": {
42
+    "plugins": {
43
+      "cordova-plugin-geolocation": {
44
+        "GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
45
+      }
46
+    }
47
+  }
39
 }
48
 }

+ 8
- 0
frontEnd/src/components/components.module.ts View File

1
+import { NgModule } from '@angular/core';
2
+import { GeolocationComponent } from './geolocation/geolocation';
3
+@NgModule({
4
+	declarations: [GeolocationComponent],
5
+	imports: [],
6
+	exports: [GeolocationComponent]
7
+})
8
+export class ComponentsModule {}

+ 4
- 0
frontEnd/src/components/geolocation/geolocation.html View File

1
+<!-- Generated template for the GeolocationComponent component -->
2
+<div>
3
+  {{text}}
4
+</div>

+ 3
- 0
frontEnd/src/components/geolocation/geolocation.scss View File

1
+geolocation {
2
+
3
+}

+ 22
- 0
frontEnd/src/components/geolocation/geolocation.ts View File

1
+import { Component } from '@angular/core';
2
+
3
+/**
4
+ * Generated class for the GeolocationComponent component.
5
+ *
6
+ * See https://angular.io/api/core/Component for more info on Angular
7
+ * Components.
8
+ */
9
+@Component({
10
+  selector: 'geolocation',
11
+  templateUrl: 'geolocation.html'
12
+})
13
+export class GeolocationComponent {
14
+
15
+  text: string;
16
+
17
+  constructor() {
18
+    console.log('Hello GeolocationComponent Component');
19
+    this.text = 'Hello World';
20
+  }
21
+
22
+}

+ 2
- 0
frontEnd/src/index.html View File

39
   <script src="build/polyfills.js"></script>
39
   <script src="build/polyfills.js"></script>
40
 
40
 
41
   <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCP_RWvkwJQWlH3MLuHZm3zcgCQfagWQio"></script>
41
   <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCP_RWvkwJQWlH3MLuHZm3zcgCQfagWQio"></script>
42
+  <script src="//www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyCP_RWvkwJQWlH3MLuHZm3zcgCQfagWQio"></script>
43
+
42
 
44
 
43
   <!-- The vendor js is generated during the build process
45
   <!-- The vendor js is generated during the build process
44
        It contains all of the dependencies in node_modules -->
46
        It contains all of the dependencies in node_modules -->