zoontek / react-native-permissions

An unified permissions API for React Native on iOS, Android and Windows.
MIT License
4.1k stars 836 forks source link

SCHEDULE_EXACT_ALARM Permission need in Android 14 #795

Closed ThushalIntervest closed 3 weeks ago

ThushalIntervest commented 1 year ago

Why it is needed?

In my project, I am utilizing the SCHEDULE_EXACT_ALARM feature. With the transition to Android 14 and onwards, there is a change in permission handling. In previous Android versions, this permission was granted by default (ALLOWED). However, starting from Android 14, there is a shift, and the default behaviour for this permission has changed to being denied by default. Therefore, in order to continue using the SCHEDULE_EXACT_ALARM feature effectively in Android 14 and beyond, it is now necessary to explicitly request and obtain the appropriate permission from the user.

Possible implementation

No response

Code sample

No response

truongduy997 commented 1 year ago

I also need this permission, please support me !!! 🥹 🥹 🥹

Screenshot 2023-09-07 at 23 17 47
ThushalIntervest commented 1 year ago

You can use Notifee Libary to request for this permission.

await notifee.openAlarmPermissionSettings();

Otherwise, I didn't find any solution for this issue

nateshmbhat commented 11 months ago

AlarmNotificationSetting.ENABLED still comes true even if we haven't explicitly requested schedule_exact_alarm in android 14 (so the permission is not enabled but still gives enabled as true)

image

ThushalIntervest commented 11 months ago

For me this works fine in android 14. This can be happen in Android 13.

gustavomts commented 10 months ago

Apparently, this is only a problem if your target SDK is >= 33

anomsejogati commented 4 months ago

Hi guys, Is there any solution for this issue without using notifee library?

zoontek commented 4 months ago

There's an open PR: https://github.com/zoontek/react-native-permissions/pull/878 But I don't have the time to review it for the moment 😕

zoontek commented 3 weeks ago

It's available in 5.1.0.