Skip to content

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.

License

Notifications You must be signed in to change notification settings

marcoalvesalmeida/react-native-magic-flashlight

Repository files navigation

react-native-magic-flashlight

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

Installation

npm install react-native-magic-flashlight

Usage

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 to learn how to contribute to the repository and the development workflow.

License

MIT


Created by Marco Almeida

About

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.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks