NappFlashLight
NappFlashLight copied to clipboard
On android: I cannot see a light
This my code:
var NappFlashLight = require('dk.napp.flashlight');
if (NappFlashLight.isFlashLightSupported()) {
Ti.API.info("hardware support for flashlight");
NappFlashLight.turnFlashLightOn();
} else {
Ti.API.error("No hardware support for flashlight");
}
On console I see the YES node
If you are on 5.0, neither can I, and on iOS I have to make my own isLightSupported() and isLightOn()
isFlashLightSupported = getApplicationContext().getPackageManager() .hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
if (!isFlashLightSupported) define what happens.