How to use the expo-battery.isLowPowerModeEnabledAsync function in expo-battery

To help you get started, we’ve selected a few expo-battery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / apps / native-component-list / src / screens / BatteryScreen.tsx View on Github external
(async () => {
      const [isAvailable, batteryLevel, batteryState, lowPowerMode] = await Promise.all([
        Battery.isAvailableAsync(),
        Battery.getBatteryLevelAsync(),
        Battery.getBatteryStateAsync(),
        Battery.isLowPowerModeEnabledAsync(),
      ]);

      setIsAvailable(isAvailable && false);
      setBatteryLevel(batteryLevel);
      setBatteryState(batteryState);
      setLowPowerMode(lowPowerMode);
    })();
    const batteryLevelListener = Battery.addBatteryLevelListener(({ batteryLevel }) =>