Closed INARTECHSA closed 1 year ago
There are multiple forks documented under issues and pull requests that address this. Seems no one is maintaining this version anymore.
for example.
https://github.com/katzer/cordova-plugin-background-mode/issues/576
I fixed it by manually opening the ForegroundService.java
file under the folder de.appplant.cordova.plugin.background
and around line 225 I changed the PendingIntent.FLAG_UPDATE_CURRENT
to PendingIntent.FLAG_IMMUTABLE
or PendingIntent.FLAG_MUTABLE
I fixed it by manually opening the
ForegroundService.java
file under the folderde.appplant.cordova.plugin.background
and around line 225 I changed thePendingIntent.FLAG_UPDATE_CURRENT
toPendingIntent.FLAG_IMMUTABLE
orPendingIntent.FLAG_MUTABLE
I love you :-) you saved my from going crazy
Im trying to use background mode with my Ionic 6 app but it gives me this error:
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
I’ve tried addingimplementation 'androidx.work:work-runtime:2.7.1'
to the gradle dependencies but no result. Any ideas on how to resolve this? Thanks!