cordova-plugin-mserviceinterface-2.0 1.0.95 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/ios/mInterface.m +23 -15
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.
|
|
3
|
+
xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.97">
|
|
4
4
|
<name>mserviceinterface-2.0</name>
|
|
5
5
|
<description>This plugin establishes the connection to the native interface and performs the requested task.</description>
|
|
6
6
|
<author>selfservit@gmail.com</author>
|
package/src/ios/mInterface.m
CHANGED
|
@@ -2358,6 +2358,7 @@
|
|
|
2358
2358
|
- (void)StartService:(CDVInvokedUrlCommand*)command
|
|
2359
2359
|
{
|
|
2360
2360
|
@try {
|
|
2361
|
+
[self KillTimers];
|
|
2361
2362
|
[self ValidateAppStateInfo];
|
|
2362
2363
|
self.QueueToServerTimer = [NSTimer scheduledTimerWithTimeInterval:5.0
|
|
2363
2364
|
target:self
|
|
@@ -2367,7 +2368,7 @@
|
|
|
2367
2368
|
double locationInterval = 0.0;
|
|
2368
2369
|
NSString * directory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
|
2369
2370
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
2370
|
-
NSString *locConfgFilePath = [NSString stringWithFormat:@"%@/%@/app_controller.json
|
|
2371
|
+
NSString *locConfgFilePath = [NSString stringWithFormat:@"%@/%@/app_controller.json", directory, [self GetAppName]];
|
|
2371
2372
|
if([fileManager fileExistsAtPath:locConfgFilePath]){
|
|
2372
2373
|
NSData *user_data = [NSData dataWithContentsOfFile:locConfgFilePath];
|
|
2373
2374
|
NSError *jsonError = nil;
|
|
@@ -2381,25 +2382,32 @@
|
|
|
2381
2382
|
NSLog(@"No location update should not be happnened..");
|
|
2382
2383
|
} else {
|
|
2383
2384
|
self.locationManager = [[CLLocationManager alloc] init];
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2385
|
+
self.locationManager.delegate = self;
|
|
2386
|
+
self.locationManager.distanceFilter = kCLDistanceFilterNone;
|
|
2387
|
+
self.locationManager.headingFilter = kCLHeadingFilterNone;
|
|
2388
|
+
|
|
2389
|
+
// Foreground-only: When In Use authorization
|
|
2389
2390
|
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2391
|
+
|
|
2392
|
+
if (status == kCLAuthorizationStatusNotDetermined) {
|
|
2393
|
+
// First time: ask for When In Use
|
|
2394
|
+
[self.locationManager requestWhenInUseAuthorization];
|
|
2395
|
+
} else if (status == kCLAuthorizationStatusAuthorizedWhenInUse ||
|
|
2396
|
+
status == kCLAuthorizationStatusAuthorizedAlways) {
|
|
2397
|
+
// Permission already granted
|
|
2398
|
+
[self.locationManager startUpdatingLocation];
|
|
2395
2399
|
}
|
|
2396
|
-
|
|
2397
|
-
|
|
2400
|
+
|
|
2401
|
+
// No allowsBackgroundLocationUpdates here
|
|
2402
|
+
|
|
2403
|
+
|
|
2398
2404
|
self.LocationTimer = [NSTimer scheduledTimerWithTimeInterval:locationInterval
|
|
2399
|
-
|
|
2405
|
+
target:self
|
|
2400
2406
|
selector:@selector(SendLocation)
|
|
2401
2407
|
userInfo:nil
|
|
2402
|
-
|
|
2408
|
+
repeats:YES];
|
|
2409
|
+
[self.LocationTimer fire];
|
|
2410
|
+
|
|
2403
2411
|
}
|
|
2404
2412
|
} else {
|
|
2405
2413
|
NSLog(@"'location_configuration' key not found in JSON.");
|