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.
- Host: GitHub
- URL: https://github.com/marcoalvesalmeida/react-native-magic-flashlight
- Owner: marcoalvesalmeida
- License: mit
- Created: 2023-01-08T13:06:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T13:06:59.000Z (over 2 years ago)
- Last Synced: 2025-03-15T19:17:19.022Z (3 months ago)
- Topics: android, flash, ios, npm-package, react-native, react-native-module, torch
- Language: Java
- Homepage: https://www.npmjs.com/package/react-native-magic-flashlight
- Size: 412 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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)