Skip to content

KrowdBeat/react-native-flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published