zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.77k stars 2.05k forks source link

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

Open mabc21 opened 4 months ago

mabc21 commented 4 months ago

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.

felipe-xavier commented 4 months ago

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.

thomasarogers commented 3 months ago

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