ionic-team / ionic-team/capacitor-background-runner

Pre-launch report: Your use of exact alarms is causing your app to crash for some Android users

Open
#112 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
56
Forks
36
Avg merge
4d 12h
Merged PRs (30d)
7

Description

I submitted my app to the Play Store, and it was rejected due to crashing. The cause:

> 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.

I checked [the official docs](https://developer.android.com/develop/background-work/services/alarms/schedule#using-schedule-exact-permission). They say check `canScheduleExactAlarms()` first. However the code seems to indeed do so.

https://github.com/ionic-team/capacitor-background-runner/blob/c290f3cd6372453b2679a4255f822fc91664fe77/packages/capacitor-plugin/android/src/main/java/io/ionic/backgroundrunner/plugin/api/Notifications.kt#L192-L194

I have added ``
to `AndroidManifest.xml`, as specified in the docs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.