JS interface to customize the notification on Android

This commit is contained in:
Sebastián Katzer
2014-11-04 14:48:14 +00:00
parent 96ae5df2ca
commit 439330a1d4
4 changed files with 98 additions and 29 deletions

View File

@@ -33,6 +33,7 @@ import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class BackgroundMode extends CordovaPlugin {
@@ -42,6 +43,9 @@ public class BackgroundMode extends CordovaPlugin {
// Flag indicates if the plugin is enabled or disabled
private boolean isDisabled = false;
// Settings for the notification
static JSONObject settings;
// Used to (un)bind the service to with the activity
private ServiceConnection connection = new ServiceConnection() {
@@ -80,6 +84,11 @@ public class BackgroundMode extends CordovaPlugin {
return true;
}
if (action.equalsIgnoreCase("configure")) {
settings = args.getJSONObject(0);
return true;
}
if (action.equalsIgnoreCase("enable")) {
enableMode();
return true;