react-native-flash

0.2.2 • Public • Published

react-native-flash

Simple API to turn on and off flash in react native

npm version npm downloads

Installation

npm install react-native-flash
react-native link react-native-flash

Usage

In your index.android.js:

import RNFlash from 'react-native-flash';
 
 
        RNFlash.turnOnFlash(); // turn on flash
 
        RNFlash.turnOffFlash(); // turn off flash
 
        /*Has flash checks if the phone has flash available.
          Since all communication between react native and native modules is asychrounous, it takes a success callback, and failure callback. atm both callbacks are necessary.
 
           */
        RNFlash.hasFlash(function(){
            RNFlash.turnOnFlash();
        },function(){
            alert("You do not have flash")
        });
});

TODO

  • Any Suggestions?

Package Sidebar

Install

npm i react-native-flash

Weekly Downloads

2

Version

0.2.2

License

MIT

Last publish

Collaborators

  • krowdbeat
  • lcd344