NappFlashLight icon indicating copy to clipboard operation
NappFlashLight copied to clipboard

On android: I cannot see a light

Open AppWerft opened this issue 11 years ago • 2 comments

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

AppWerft avatar Jan 19 '15 17:01 AppWerft

If you are on 5.0, neither can I, and on iOS I have to make my own isLightSupported() and isLightOn()

gabeaguirre avatar Jan 22 '15 17:01 gabeaguirre

isFlashLightSupported = getApplicationContext().getPackageManager() .hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);

if (!isFlashLightSupported) define what happens.

CookieMaster avatar Feb 26 '15 03:02 CookieMaster