# react-native-battery-monitor

> Battery Monitor for React Native

Latest version **0.0.2** (published 2020-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-battery-monitor
pnpm add react-native-battery-monitor
yarn add react-native-battery-monitor
bun add react-native-battery-monitor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-05-09 |
| First published | 2020-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 111.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tadaaki Onishi |
| Maintainers | tadko |
| Keywords | react-native, react, native, battery, monitor |

## Links

- npm: https://www.npmjs.com/package/react-native-battery-monitor
- Repository: https://github.com/tadko/react-native-battery-monitor
- Homepage: https://github.com/tadko/react-native-battery-monitor#readme
- Issues: https://github.com/tadko/react-native-battery-monitor/issues
- npm.io page: https://npm.io/package/react-native-battery-monitor

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-05-09
- 0.0.1 — 2020-05-08
- 0.0.0-development — 2020-05-08

## README

<h1 align="center">react-native-battery-monitor</h1>
<p align="center">Battery Monitor for React Native.</p>

[![npm version](https://badge.fury.io/js/react-native-battery-monitor.svg)](http://badge.fury.io/js/react-native-battery-monitor)

## 🚀 Getting Started

### Prerequisites

- react-native:
  - supported versions "<strong>&gt;= 0.60.0</strong>"

### Installation

<table>
<td>
<details style="border: 1px solid; border-radius: 5px; padding: 5px">
  <summary>with react-native "<strong>&gt;=0.60.0</strong>"</summary>

### 1. Install latest version

```
# Using npm
npm install --save react-native-battery-monitor

# Using Yarn
yarn add react-native-battery-monitor
```

### 2. Install pods

`$ cd ios && pod install && cd ..`

</details>
</td>
</table>

## 🍰 Example

```jsx
import BatteryMonitor from 'react-native-battery-monitor';

const ubsubscribe = BatteryMonitor.onStateChange((status) => {
  console.log(status.state); //  "unknown" | "unplugged" | "charging" | "full"
  console.log(status.level); // 0.80000001192092
});

const batteryState = await BatteryMonitor.getBatteryState();

// unsubscribe
ubsubscribe();
```

---
_Source: https://npm.io/package/react-native-battery-monitor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
