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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -