cordova-plugin-mserviceinterface-2.0 1.0.44 → 1.0.45
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/android/mInterface.java +15 -0
package/package.json
CHANGED
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.
|
|
5
|
+
version="1.0.45">
|
|
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>
|
|
@@ -60,6 +60,7 @@ import com.google.android.gms.location.LocationSettingsStatusCodes;
|
|
|
60
60
|
import com.google.android.gms.tasks.Task;
|
|
61
61
|
import com.google.zxing.integration.android.IntentIntegrator;
|
|
62
62
|
import com.google.zxing.integration.android.IntentResult;
|
|
63
|
+
import com.onesignal.OSDeviceState;
|
|
63
64
|
import com.onesignal.OneSignal;
|
|
64
65
|
|
|
65
66
|
import org.apache.cordova.CallbackContext;
|
|
@@ -205,6 +206,20 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
205
206
|
System.out.println("Exception is: " + e.getMessage());
|
|
206
207
|
callbackContext.error(e.getMessage());
|
|
207
208
|
}
|
|
209
|
+
}else if (action.equals("GetFCMUtils")) {
|
|
210
|
+
try {
|
|
211
|
+
OSDeviceState device = OneSignal.getDeviceState();
|
|
212
|
+
String userId = device.getUserId();
|
|
213
|
+
//Get device's push token identifier
|
|
214
|
+
String pushToken = device.getPushToken();
|
|
215
|
+
JSONObject progressObj = new JSONObject();
|
|
216
|
+
progressObj.put("userId", userId);
|
|
217
|
+
progressObj.put("pushToken", pushToken);
|
|
218
|
+
callbackContext.success(progressObj);
|
|
219
|
+
} catch (Exception e) {
|
|
220
|
+
System.out.println("Exception is: " + e.getMessage());
|
|
221
|
+
callbackContext.error(e.getMessage());
|
|
222
|
+
}
|
|
208
223
|
} else if (action.equals("GetSyncIndicator")) {
|
|
209
224
|
try {
|
|
210
225
|
File newQueueFolder, oldQueueFolder;
|