iphone - Detect LED Flash for Alerts setting status in code -


how can detect "led flash alerts" (from settings) status in code? have tried:

avcapturedevice *torched=[avcapturedevice defaultdevicewithmediatype:avmediatypevideo];     bool test = torched.torchmode; bool test1 = torched.flashmode; 

but seams not need.

do this,

bool test=no; bool test1=no;  class capturedeviceclass = nsclassfromstring(@"avcapturedevice"); if (capturedeviceclass != nil) {     avcapturedevice *device = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo];     if ([device hastorch] && [device hasflash]){        if(device.flashmode==avcaptureflashmodeon)           nslog(@"on");        else           nslog(@"off");     } } 

hope helps you....


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -