feat: section 4 — Android battery optimization prompt
One-time prompt on first launch (Android only) directing the user to exclude bincio-rec from battery optimization. Uses the direct REQUEST_IGNORE_BATTERY_OPTIMIZATIONS system dialog with a fallback to the general settings page for OEMs that block the direct intent. Dismissal persisted in AsyncStorage so prompt never repeats.
This commit is contained in:
@@ -4,6 +4,7 @@ import * as Notifications from 'expo-notifications';
|
||||
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
import { AppNavigator } from './src/navigation/AppNavigator';
|
||||
import { requestNotificationPermissions } from './src/services/gps';
|
||||
import { promptBatteryOptimizationIfNeeded } from './src/services/batteryOptimization';
|
||||
|
||||
// Show notifications even when the app is in the foreground (iOS suppresses by default)
|
||||
Notifications.setNotificationHandler({
|
||||
@@ -18,6 +19,7 @@ Notifications.setNotificationHandler({
|
||||
export default function App() {
|
||||
useEffect(() => {
|
||||
requestNotificationPermissions();
|
||||
promptBatteryOptimizationIfNeeded();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user