react-native-flash
v0.2.2
Published
React Native module to turn flash on and off
Readme
react-native-flash
Simple API to turn on and off flash in react native
Installation
npm install react-native-flash
react-native link react-native-flashUsage
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?
