An open API service indexing awesome lists of open source software.

https://github.com/marcoalvesalmeida/react-native-magic-flashlight

Uma biblioteca simples react native para ligar ou desligar o flash no dispositivo Android/iOS. A simple react native library to turn on or off flash on Android/iOS device.
https://github.com/marcoalvesalmeida/react-native-magic-flashlight

android flash ios npm-package react-native react-native-module torch

Last synced: 3 months ago
JSON representation

Uma biblioteca simples react native para ligar ou desligar o flash no dispositivo Android/iOS. A simple react native library to turn on or off flash on Android/iOS device.

Awesome Lists containing this project

README

        

# react-native-magic-flashlight

A simple library to turn on or off flash on Android/iOS device.

## Installation

```sh
npm install react-native-magic-flashlight
```

## Usage

```js
import {
toggleFlash,
isFlashOn,
hasFlash,
} from 'react-native-magic-flashlight';

// ...

function deviceHasFlash() {
hasFlash(
() => console.log('Has Flash'),
() => console.log('No Flash')
);
}

function turnOn() {
toggleFlash(
true,
() => console.log('Success'),
() => console.log('Error')
);
}

function flashIsOn() {
const result = isFlashOn((on) => on);
console.log(result);
}
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Created by [Marco Almeida](https://github.com/marcoalvesalmeida)