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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -