react-native-flash

React Native module to turn flash on and off


Keywords
React-Native, iOS, Flash, Android
License
MIT
Install
npm install react-native-flash@0.2.2

Documentation

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?