thudugala / thudugala/Plugin.LocalNotification

[Android] Your app schedules exact alarms without checking whether the SCHEDULE_EXACT_ALARM permission has been granted.

Open
#465 25 comments 4 reactions 1 assignee View on GitHub

@thudugala is already working on this.

Since Jan 13, 2024.

Android bug
Dominant language
C#
Stars
474
Forks
73
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When publishing release builds to the Google Play Developer Console, I found that it is showing me an error for the SCHEDULE_EXACT_ALARM permission. The exact error is:

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.

The AndroidManifest has the permissions enabled outlined in the Wiki for this plugin, including the SCHEDULE_EXACT_ALARM permission. When testing via debug, I can see the notification that was scheduled fine (Google Pixel 5 emulator & My own Google Pixel 7 Pro).

I'm aware you can use Android specific namespaces to request this permission manually, however the issue is I am planning to also make a build for iOS, and from my experience prior to knowing about this plugin, I tried to create notifications via Intent, however the build would fail since iOS does not know about Android specific code. Even by conditionally registering an Android class via Dependency Injection with #if Android.

To Reproduce
Steps to reproduce the behavior:

  1. Install Plugin.LocalNotifications
  2. Set a notification to appear by scheduling a DateTime.
  3. Publish the release to Google Play Console (Internal testing etc)
  4. See error

Expected behavior
I should expect the plugin to have the ability to request missing permissions that it uses internally, instead of just one ability to Request Notification permissions.

Platform (please complete the following information):

  • OS: Android
  • Version 14

Smartphone (please complete the following information):

  • Device: Google Pixel
  • OS: Android
  • Version 14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.