react native magic flashlight
1.0.0
一個簡單的庫,可在Android/iOS設備上打開或關閉閃光燈。
npm install react-native-magic-flashlight import {
toggleFlash ,
isFlashOn ,
hasFlash ,
} from 'react-native-magic-flashlight' ;
// ...
function deviceHasFlash ( ) {
hasFlash (
( ) => console . log ( 'Has Flash' ) ,
( ) => console . log ( 'No Flash' )
) ;
}
function turnOn ( ) {
toggleFlash (
true ,
( ) => console . log ( 'Success' ) ,
( ) => console . log ( 'Error' )
) ;
}
function flashIsOn ( ) {
const result = isFlashOn ( ( on ) => on ) ;
console . log ( result ) ;
} 請參閱了解如何為存儲庫和開發工作流程貢獻的貢獻指南。
麻省理工學院
由Marco Almeida創建