diff --git a/plugin.xml b/plugin.xml index 0156c5d..4ecb52c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,8 +1,8 @@ + id="com.dbn.phonegap.plugin.backgroundservice" + version="2.0.1"> Background Service Plugin - Core logic @@ -41,8 +41,7 @@ - - + diff --git a/src/android/BackgroundServicePluginLogic.java b/src/android/BackgroundServicePluginLogic.java index c33703f..9d5abb3 100644 --- a/src/android/BackgroundServicePluginLogic.java +++ b/src/android/BackgroundServicePluginLogic.java @@ -161,6 +161,12 @@ public ExecuteResult execute(String action, JSONArray data, IUpdateListener list (data.getString(0).length() > 0)) { String serviceName = data.getString(0); + String serviceClassName = serviceName; + String[] serviceNameTokens = serviceName.split("`"); + if(serviceNameTokens.length > 1) { + serviceClassName = serviceNameTokens[0]; + serviceName = serviceNameTokens[1]; + } Log.d(TAG, "Finding servicename " + serviceName); @@ -173,7 +179,7 @@ public ExecuteResult execute(String action, JSONArray data, IUpdateListener list service = this.mServices.get(serviceName); } else { Log.d(TAG, "Creating new Service Details"); - service = new ServiceDetails(this.mContext, serviceName); + service = new ServiceDetails(this.mContext, serviceClassName); this.mServices.put(serviceName, service); }