Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background mode gives Error Targeting S+ (version 31 and above) on android #577

Closed
INARTECHSA opened this issue Dec 22, 2022 · 3 comments
Closed

Comments

@INARTECHSA
Copy link

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 adding implementation 'androidx.work:work-runtime:2.7.1' to the gradle dependencies but no result. Any ideas on how to resolve this? Thanks!

@alindzon
Copy link

There are multiple forks documented under issues and pull requests that address this. Seems no one is maintaining this version anymore.

for example.

#576

@INARTECHSA
Copy link
Author

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

jaspeon-hero added a commit to dejiren/cordova-plugin-background-mode that referenced this issue Dec 27, 2022
jaspeon-hero added a commit to dejiren/cordova-plugin-background-mode that referenced this issue Apr 10, 2023
@mauro81pzm
Copy link

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 love you :-) you saved my from going crazy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants