# rn-system-brightness

> is a small and simple package that helps make your React Native app

Latest version **0.0.6** (published 2021-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-system-brightness
pnpm add rn-system-brightness
yarn add rn-system-brightness
bun add rn-system-brightness
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2021-01-06 |
| First published | 2021-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 89.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Hoang Lam |
| Maintainers | hlam104 |
| Keywords | react-native, rn-system-brightness, react native brightness, brightness |

## Links

- npm: https://www.npmjs.com/package/rn-system-brightness
- Repository: https://github.com/hoanglam10499/rn-system-brightness
- Issues: https://github.com/hoanglam10499/rn-system-brightness/issues
- npm.io page: https://npm.io/package/rn-system-brightness

## Recent versions

- 0.0.6 (latest) — 2021-01-06
- 0.0.5 — 2021-01-04
- 0.0.4 — 2021-01-04
- 0.0.3 — 2021-01-03
- 0.0.2 — 2021-01-03
- 0.0.1 — 2021-01-03

## README

# RN System Brightness

Access and update the system brightness on a device Android vs IOS

## Install

[![npm version](https://img.shields.io/npm/v/rn-system-brightness?color=green)](https://www.npmjs.com/package/rn-system-brightness) [![npm download](https://img.shields.io/npm/dm/rn-system-brightness?color=blue)](https://www.npmjs.com/package/rn-system-brightness)

```shell
yarn add rn-system-brightness
```

```shell
npm i --save rn-system-brightness
```

## Setup

#### Android

Also update you manifest params and include xmlns:tools

```js
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.baseproject"
  xmlns:tools="http://schemas.android.com/tools"> // <---add
```

Open the manifest file of your Android project and add

```js
<uses-permission
  android:name="android.permission.WRITE_SETTINGS"
  tools:ignore="ProtectedPermissions"
/>
```

#### IOS

```js
cd ios
pod install
```

#### API

```js
import Brightness from "rn-system-brightness";

// SET
await Brightness.setBrightness(0.8); // between 0 and 1

// GET
const brightness = await Brightness.getBrightness();

// GET max brightness
const maxBrightness = await Brightness.getMaxBrightness();

// GET Permission ANDROID
const per = await Brightness.hasPermission(); // boolean true or false

// REQUEST ANDROID > 6
await Brightness.requestPermission();
```

---
_Source: https://npm.io/package/rn-system-brightness · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
