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

App crashes when enabling background mode on Android 12+ (target SDK level 31+) #585

Closed
Mforcen opened this issue Jul 12, 2023 · 5 comments

Comments

@Mforcen
Copy link

Mforcen commented Jul 12, 2023

From Android 12 and newer, when trying to create a PendingIntent one of the following flags are required: FLAG_IMMUTABLE or FLAG_MUTABLE.
The offending API call is located in the file ForegroundService.java:223.

Best regards.

@Mforcen
Copy link
Author

Mforcen commented Jul 12, 2023

I've fixed the PendingIntent crash in my fork: https://github.com/Mforcen/cordova-plugin-background-mode

Best regards.

@jlherren
Copy link

Thanks, this is actually really useful. The fork can be installed using

cordova plugin add 'https://github.com/Mforcen/cordova-plugin-background-mode#2b9a4de'

@wuitoonchi
Copy link

@Mforcen When you have time, it would be good if possible to upload or publish the plugin in npm so that it is available to the community, some time is usually wasted looking for how to solve the issue. I thank you very much in advance for your contribution.

@Mforcen
Copy link
Author

Mforcen commented May 3, 2024

@Mforcen When you have time, it would be good if possible to upload or publish the plugin in npm so that it is available to the community, some time is usually wasted looking for how to solve the issue. I thank you very much in advance for your contribution.

Yeah! Will do as soon as I get to my computer!

@Mforcen
Copy link
Author

Mforcen commented May 15, 2024

Hi @wuitoonchi, I've seen that there are already other versions of this plugin on NPM with the fix applied.
Please use this, for example: https://www.npmjs.com/package/@andeo/cordova-plugin-background-mode

@Mforcen Mforcen closed this as completed May 15, 2024
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