MaikuB / flutter_local_notifications

A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
2.46k stars 1.4k forks source link

I can't use Exact Alarm #2397

Closed jiayixu420 closed 1 month ago

jiayixu420 commented 2 months ago

Hi! Currently, I am trying to display a notification in my app using flutter_local_notifications: ^17.2.2. The feature I am trying to implement in my app is to display a notification so that the user can use the app again the next day or later after opening the app today. At this time, the notification time is the time when the app was previously opened. I have already written the code for the scheduled notification and tested it locally. If I add the permission below to the AndroidManifest.xml file, the notification works well.

<uses-permission android:name="android.permission.USE_EXACT_ALARM" />

However, when I try to upload the app to the Google Play Store, I get the following error message and cannot publish it.

Publishing failed :| Google Play failed to upload artefacts. You must let us know whether your app uses any exact alarm permissions: { "error": { "code": 403, "message": "You must let us know whether your app uses any exact alarm permissions", "status": "PERMISSION_DENIED" }

What should I do to resolve this issue?

OutdatedGuy commented 1 month ago

Hi @jiayixu420, you need to specify your use case of USE_EXACT_ALARM permission in the Google Play Console.

Steps:

  1. Open Google Play Console
  2. Select your App from the list presented
  3. Open App Content from Menu/Drawer at left (Scroll to the bottom)
  4. Select the Exact alarms option from the Needs attention tab
  5. Select your use case and submit
MaikuB commented 1 month ago

Closing as @OutdatedGuy as provided the answer. A reminder that the readme covers that making use of exact alarms can be done through two different approaches. What's mentioned there is to do with how Android works as opposed to being a direct requirement of the plugin. With that in mind, I suggest understanding Android more for future reference as well