New Google Play warning - probably caused by Notification scheduling

We uploaded a new build to the console today, and saw a warning/error that we haven’t seen before:

Your use of exact alarms is causing your app to crash for some Android users
Your app schedules exact alarms without checking whether the SCHEDULE_EXACT_ALARM permission has been granted. This is causing your app to crash for users on Android 14 because the permission is no longer granted by default.

In most cases, alternative methods of scheduling work or inexact alarms are more appropriate. If your use of exact alarms is justified, update your app so that it checks this permission is granted before scheduling.

This isn’t something we’ve had reported by users, but presumably Google Play is detecting it happening. I assume this is being triggered by local notification scheduling, I’m not sure we have anything else in the app that is scheduled for a specific time.

I’m not sure how the notification plugin sets notification timings, but according to this they should “Use an inexact alarm” via the setAndAllowWhileIdle(), set() or setWindow() methods:

Is this something that could be easily changed?

1 Like

I am experiencing this exact issue. @alanFlickGames how did you fix it?
@vlads can this be changed as google recommends “inexact alarms are more appropriate” ?

Here’s the exact message:

Thank you for reporting this. I created GitHub issue for this Android: investigate and fix exact alarms crash on Android 14 · Issue #676 · coronalabs/corona · GitHub

I didn’t manage to fix it, and then I couldn’t find the error message in Google Play so wasn’t sure if it was something that fixed itself somehow.
Hopefully now that it’s logged as an issue it’s not too difficult a fix.