react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

Caller APPID needs to hold android.permission.SCHEDULE_EXACT_ALARM or android.permission.USE_EXACT_ALARM to set exact alarms.

Open mabc21 opened this issue 1 year ago • 2 comments

Device info: Android 13 and 14 React-native-push-notification version: 8.1.1

In AndroidManifest I used to have

BUT google wants to remove USE_EXACT_ALARM if your app's main core functionality is not an alarm clock or a calendar. I removed USE_EXACT_ALARM and now my app is crashing when sending local notifications.

mabc21 avatar Jul 11 '24 00:07 mabc21

Hi, I got this issue too. I found 2 possible solutions, but not implemented for production from our side yet:

  1. Use the notifee libraby with method getNotificationSettings: https://notifee.app/react-native/docs/triggers#android-12-limitations

  2. Use native code no AndroidManifest.xml file according to this article: https://medium.com/@aarie33/schedule-exact-alarms-are-denied-by-default-onandroid-14-ccbfbf54586c

I hope some of these solutions work for you and others. But wonder if this will be updated from react-native-push-notification side as well.

felipe-xavier avatar Jul 11 '24 08:07 felipe-xavier

I am having this issue and trying to fix with the second recommendation by felipe-xavier but when I display the modal for Users to grant the permission it is greyed out and cannot be enabled? Any ideas anyone? Screenshot_20240822-111556

thomasarogers avatar Aug 22 '24 15:08 thomasarogers