cordova-plugin-mserviceinterface-2.0 1.0.38 → 1.0.39

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.38",
3
+ "version": "1.0.39",
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": {
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.38">
5
+ version="1.0.39">
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>
@@ -10,6 +10,8 @@
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>
13
15
  #import <objc/runtime.h>
14
16
 
15
17
  #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@@ -27,6 +29,15 @@
27
29
  @synthesize controller = docController;
28
30
  @synthesize callbackID;
29
31
 
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
+
30
41
  -(void)GetBase64String:(CDVInvokedUrlCommand *)command {
31
42
  NSMutableDictionary *dict = [[command arguments] objectAtIndex:0];
32
43
  NSString *directory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];