Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-emsprovider-sdk" version="1.0.1">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-emsprovider-sdk" version="1.0.2">
<name>EMS Launcher Provider Plugin</name>
<description>Companion Cordova plugin for the EMS Launcher Provider SDK</description>
<license>MIT</license>
Expand Down
24 changes: 18 additions & 6 deletions src/android/com/bluefletch/ems/LauncherProviderPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ public boolean execute(final String action, final JSONArray args, final Callback
Context context = cordova.getActivity().getApplicationContext();

if (action.equals("getCurrentSessionAsJson")) {

String currentSession = LauncherProviderHelper.getCurrentSessionAsJson(context);
JSONObject sessionObject = new JSONObject(currentSession);
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, sessionObject);
pluginResult.setKeepCallback(true);
callbackContext.sendPluginResult(pluginResult);
cordova.getThreadPool().execute(new Runnable() {
@Override
public void run() {
String currentSession = LauncherProviderHelper.getCurrentSessionAsJson(context);
if(currentSession == null || currentSession.isEmpty()){
currentSession = "{\"groups\":\"*\"}";
}
JSONObject sessionObject = null;
try {
sessionObject = new JSONObject(currentSession);
} catch (JSONException e) {
e.printStackTrace();
}
// PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, sessionObject);
// pluginResult.setKeepCallback(false);
callbackContext.success(sessionObject);
}
});
}
else if (action.equals("addConfigExtAttribute")) {
LauncherProviderHelper.addConfigExtAttribute(context, args.getString(0), args.getString(1));
Expand Down
1 change: 1 addition & 0 deletions src/android/launcherProvider.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repositories{

dependencies {
implementation(name:'launcherProvider-3.4.7', ext:'aar')
implementation 'com.jakewharton.timber:timber:5.0.1'
}

android {
Expand Down