我正在使用
katzer/cordova-plugin-local-notifications
和
katzer/backgroundservice
但后台服务正在使用前台通知,当我的应用程序进入后台并且它收到来自服务器的任何请求时,它正在生成通知与前台通知冲突,我的服务停止工作。
我使用以下代码进行通知,但LED未显示任何颜色。
window.plugin.notification.local.add({ led: 'A0FF05' });
当我的应用程序暂停时,后台服务以巨大的错误
开始12-23 13:54:08.180: E/ActivityThread(15572): Activity com.example.test.CordovaApp has leaked ServiceConnection de.appplant.cordova.plugin.background.BackgroundMode$1@426a9df8 that was originally bound here
12-23 13:54:08.180: E/ActivityThread(15572): android.app.ServiceConnectionLeaked: Activity com.example.test.CordovaApp has leaked ServiceConnection de.appplant.cordova.plugin.background.BackgroundMode$1@426a9df8 that was originally bound here
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:965)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:859)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ContextImpl.bindService(ContextImpl.java:1344)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ContextImpl.bindService(ContextImpl.java:1336)
12-23 13:54:08.180: E/ActivityThread(15572): at android.content.ContextWrapper.bindService(ContextWrapper.java:401)
12-23 13:54:08.180: E/ActivityThread(15572): at de.appplant.cordova.plugin.background.BackgroundMode.startService(BackgroundMode.java:241)
12-23 13:54:08.180: E/ActivityThread(15572): at de.appplant.cordova.plugin.background.BackgroundMode.onDestroy(BackgroundMode.java:154)
12-23 13:54:08.180: E/ActivityThread(15572): at org.apache.cordova.PluginManager.onDestroy(PluginManager.java:255)
12-23 13:54:08.180: E/ActivityThread(15572): at org.apache.cordova.CordovaWebView.handleDestroy(CordovaWebView.java:794)
12-23 13:54:08.180: E/ActivityThread(15572): at org.apache.cordova.CordovaActivity.onDestroy(CordovaActivity.java:649)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.Activity.performDestroy(Activity.java:5370)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1113)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3301)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3332)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ActivityThread.access$1200(ActivityThread.java:140)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-23 13:54:08.180: E/ActivityThread(15572): at android.os.Handler.dispatchMessage(Handler.java:99)
12-23 13:54:08.180: E/ActivityThread(15572): at android.os.Looper.loop(Looper.java:137)
12-23 13:54:08.180: E/ActivityThread(15572): at android.app.ActivityThread.main(ActivityThread.java:4898)
12-23 13:54:08.180: E/ActivityThread(15572): at java.lang.reflect.Method.invokeNative(Native Method)
12-23 13:54:08.180: E/ActivityThread(15572): at java.lang.reflect.Method.invoke(Method.java:511)
12-23 13:54:08.180: E/ActivityThread(15572): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
12-23 13:54:08.180: E/ActivityThread(15572): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
12-23 13:54:08.180: E/ActivityThread(15572): at dalvik.system.NativeStart.main(Native Method)
请告诉我将应用程序作为后台服务运行但没有任何前台服务或通知的解决方案