cordova-plugin-mserviceinterface-2.0 1.0.28 → 1.0.32

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-mserviceinterface-2.0",
3
- "version": "1.0.28",
3
+ "version": "1.0.32",
4
4
  "description": "This plugin establishes the connection to the native interface and performs the requested task.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,4 +25,4 @@
25
25
  "version": ">=5.0.0"
26
26
  }
27
27
  ]
28
- }
28
+ }
package/plugin.xml CHANGED
@@ -2,7 +2,7 @@
2
2
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
3
  xmlns:android="http://schemas.android.com/apk/res/android"
4
4
  id="cordova-plugin-mserviceinterface-2.0"
5
- version="1.0.28">
5
+ version="1.0.32">
6
6
  <name>mserviceinterface-2.0</name>
7
7
  <description>This plugin establishes the connection to the native interface and performs the requested task.</description>
8
8
  <author>selfservit@gmail.com</author>
@@ -208,16 +208,19 @@ public class mInterfaceService extends Service implements com.google.android.gms
208
208
  }
209
209
  }
210
210
  };
211
- setLocationTimeInterval = new Timer();
212
- setLocationTimeInterval.schedule(timerTask, Integer.parseInt(serverDateObj.optString("location_fetch_interval_in_seconds")), Integer.parseInt(serverDateObj.optString("location_fetch_interval_in_seconds")));
213
- MINIMUM_INTERVAL = Long.parseLong(serverDateObj.optString("location_fetch_interval_in_seconds").toString());
214
- createLocationRequest();
215
- this.mGoogleApiClient = new GoogleApiClient.Builder(this)
216
- .addConnectionCallbacks(this)
217
- .addOnConnectionFailedListener(this)
218
- .addApi(LocationServices.API)
219
- .build();
220
- mGoogleApiClient.connect();
211
+ if(setLocationTimeInterval == null){
212
+ setLocationTimeInterval = new Timer();
213
+ setLocationTimeInterval.schedule(timerTask, Integer.parseInt(serverDateObj.optString("location_fetch_interval_in_seconds")), Integer.parseInt(serverDateObj.optString("location_fetch_interval_in_seconds")));
214
+ MINIMUM_INTERVAL = Long.parseLong(serverDateObj.optString("location_fetch_interval_in_seconds").toString());
215
+ createLocationRequest();
216
+ this.mGoogleApiClient = new GoogleApiClient.Builder(this)
217
+ .addConnectionCallbacks(this)
218
+ .addOnConnectionFailedListener(this)
219
+ .addApi(LocationServices.API)
220
+ .build();
221
+ mGoogleApiClient.connect();
222
+ };
223
+
221
224
  }
222
225
  }
223
226
  } else {
@@ -10,8 +10,6 @@
10
10
  #include <sys/types.h>
11
11
  #include <sys/sysctl.h>
12
12
  #include "TargetConditionals.h"
13
- #import "OneSignalPush.h"
14
- #import <OneSignal/OneSignal.h>
15
13
  #import <objc/runtime.h>
16
14
 
17
15
  #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@@ -29,15 +27,6 @@
29
27
  @synthesize controller = docController;
30
28
  @synthesize callbackID;
31
29
 
32
- - (void)GetFCMUtils:(CDVInvokedUrlCommand *)command {
33
- OSDeviceState *deviceState = [OneSignal getDeviceState];
34
- NSMutableDictionary * deviceDict = [[NSMutableDictionary alloc] init];
35
- [deviceDict setValue:deviceState.userId forKey:@"userId"];
36
- [deviceDict setValue:deviceState.pushToken forKey:@"pushToken"];
37
- CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceDict];
38
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
39
- }
40
-
41
30
  -(void)GetBase64String:(CDVInvokedUrlCommand *)command {
42
31
  NSMutableDictionary *dict = [[command arguments] objectAtIndex:0];
43
32
  NSString *directory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
@@ -372,6 +361,7 @@
372
361
 
373
362
  - (void)GetSubDirectoryList:(CDVInvokedUrlCommand *)command {
374
363
  BOOL isDir;
364
+ NSString *resultString = @"";
375
365
  NSMutableDictionary * dict = [[command arguments] objectAtIndex:0];
376
366
  NSString *directory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
377
367
  NSString *contentsPath = [NSString stringWithFormat:@"%@/%@", directory, dict[@"filePath"]];
@@ -381,16 +371,23 @@
381
371
  [contenstMutableArray removeObject:@".DS_Store"];
382
372
  }
383
373
  for(int index = 0; index < [contenstMutableArray count]; index++) {
384
- if (![[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && isDir) {
385
- [contenstMutableArray removeObject:contenstMutableArray[index]];
374
+ if ([[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && isDir) {
375
+ if ([resultString isEqualToString:@""]) {
376
+ resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
377
+ }
378
+ else {
379
+ resultString = [resultString stringByAppendingString:@"|"];
380
+ resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
381
+ }
386
382
  }
387
383
  }
388
- CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:contenstMutableArray];
384
+ CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resultString];
389
385
  [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
390
386
  }
391
387
 
392
388
  - (void)GetFileList:(CDVInvokedUrlCommand *)command {
393
389
  BOOL isDir;
390
+ NSString *resultString = @"";
394
391
  NSMutableDictionary * dict = [[command arguments] objectAtIndex:0];
395
392
  NSString *directory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
396
393
  NSString *contentsPath = [NSString stringWithFormat:@"%@/%@", directory, dict[@"filePath"]];
@@ -400,11 +397,17 @@
400
397
  [contenstMutableArray removeObject:@".DS_Store"];
401
398
  }
402
399
  for(int index = 0; index < [contenstMutableArray count]; index++) {
403
- if ([[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && isDir) {
404
- [contenstMutableArray removeObject:contenstMutableArray[index]];
400
+ if ([[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && !isDir) {
401
+ if ([resultString isEqualToString:@""]) {
402
+ resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
403
+ }
404
+ else {
405
+ resultString = [resultString stringByAppendingString:@"|"];
406
+ resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
407
+ }
405
408
  }
406
409
  }
407
- CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:contenstMutableArray];
410
+ CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resultString];
408
411
  [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
409
412
  }
410
413