react-native-background-geolocation
react-native-background-geolocation copied to clipboard
[Bug]: Use of alarms no longer possible after adding the package (Android)
Required Reading
- [x] Confirmed
Plugin Version
4.18.6
Mobile operating-system(s)
- [ ] iOS
- [x] Android
Device Manufacturer(s) and Model(s)
Google Pixel 7A
Device operating-systems(s)
Android 15
React Native / Expo version
0.77.2
What happened?
Independently of this package, we use the Alarm Manager in our app. We are not a calendar app and therefore have to redirect the user to the app's settings page to prompt the user for the alarm permission. After we added this package, this option was suddenly grayed out:
After inspecting the MergedManifest of my build, I realized that the cause is that the package for SCHEDULE_EXACT_ALARM defines 33 as maxSdkVersion:
<uses-permission
android:name="android.permission.SCHEDULE_EXACT_ALARM"
android:maxSdkVersion="33"
/>
To work around the problem, I now use the following entry in my Android manifest:
<uses-permission
android:name="android.permission.SCHEDULE_EXACT_ALARM"
tools:node="merge"
tools:remove="android:maxSdkVersion"
/>
My main question is: Why is 33 set as maxSdk here? Do I have to worry about any problems with the package?
Addition: Of course I have read the section about the Alarm Managerin the documentation, but USE_EXACT_ALARM did not fix this problem.
Plugin Code and/or Config
-
Relevant log output
-