@mertozyilmazz/react-native-flash

1.0.3 • Public • Published

react-native-flash

Simple API to turn on and off flash in react native

npm version npm downloads

Installation

npm install @mertozyilmazz/react-native-flash
or
yarn add @mertozyilmazz/react-native-flash

Usage

In your *.js:

	import Flash from '@mertozyilmazz/react-native-flash'

	Flash.turnOnFlash() // turn on flash

	Flash.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.

		*/
	Flash.hasFlash(function(){
		Flash.turnOnFlash()
	},function(){
		alert("You do not have flash")
	})
})

Package Sidebar

Install

npm i @mertozyilmazz/react-native-flash

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

18.3 kB

Total Files

11

Last publish

Collaborators

  • mertozyilmazz