diff --git a/src/android/BackgroundMode.java b/src/android/BackgroundMode.java index e2fed28..ae8ada5 100644 --- a/src/android/BackgroundMode.java +++ b/src/android/BackgroundMode.java @@ -82,7 +82,7 @@ public class BackgroundMode extends CordovaPlugin { public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); IntentFilter filter = new IntentFilter(); - filter.addAction("com.backgroundmode.close"); + filter.addAction("com.backgroundmode.close" + cordova.getContext().getPackageName()); cordova.getActivity().registerReceiver(receiver, filter); } diff --git a/src/android/ForegroundService.java b/src/android/ForegroundService.java index 9c78454..e4ae337 100644 --- a/src/android/ForegroundService.java +++ b/src/android/ForegroundService.java @@ -208,7 +208,7 @@ public class ForegroundService extends Service { if (settings.optBoolean("allowClose", false)) { - final Intent clostAppIntent = new Intent("com.backgroundmode.close"); + final Intent clostAppIntent = new Intent("com.backgroundmode.close" + pkgName); final PendingIntent closeIntent = PendingIntent.getBroadcast(context, 1337, clostAppIntent, 0); final String closeIconName = settings.optString("closeIcon", "power"); NotificationCompat.Action.Builder closeAction = new NotificationCompat.Action.Builder(getIconResId(closeIconName), settings.optString("closeTitle", "Close"), closeIntent);