katzer / cordova-plugin-background-mode

Keep app running in background
Apache License 2.0
1.38k stars 1.02k forks source link

For those finding this plugin not working, here's the alternative. #588

Open panlina opened 10 months ago

panlina commented 10 months ago

Spent half day and finally get this alternative from this issue: https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background

This project is outdated and no longer maintained. Don't waste time on it.

Metalchocobo commented 9 months ago

@panlina thankyou

alanmilinovic commented 5 months ago

Alternative also doesn't work with android 13.

ArvyRogerio commented 2 months ago

Ok on 14: cordova plugin add https://github.com/brunochikuji/cordova-plugin-background-mode.git

alanmilinovic commented 2 months ago

Do I need to add some permissions or something for this plugin to work?

gondp commented 2 months ago

Ok on 14: cordova plugin add https://github.com/brunochikuji/cordova-plugin-background-mode.git

This doesn't work java.lang.RuntimeException: Unable to create service de.appplant.cordova.plugin.background.ForegroundService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecor

targetSDK=34

Process: com.radiopopular.mobile, PID: 30344 java.lang.RuntimeException: Unable to create service de.appplant.cordova.plugin.background.ForegroundService: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{f832a8 30344:} targetSDK=34 at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664) at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Caused by: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{f832a8 30344:com.radiopopular.mobile/u0a191} targetSDK=34 at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:53) at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:49) at android.os.Parcel.readParcelableInternal(Parcel.java:4870) at android.os.Parcel.readParcelable(Parcel.java:4852) at android.os.Parcel.createExceptionOrNull(Parcel.java:3052) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761) at android.app.Service.startForeground(Service.java:775) at de.appplant.cordova.plugin.background.ForegroundService.keepAwake(ForegroundService.java:132) at de.appplant.cordova.plugin.background.ForegroundService.onCreate(ForegroundService.java:100) at android.app.ActivityThread.handleCreateService(ActivityThread.java:4651) at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:205)  at android.os.Looper.loop(Looper.java:294)  at android.app.ActivityThread.main(ActivityThread.java:8177)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)