how can I blink flashlight of iphone on local / Remote notification

ios7, iphone, objective-c

Solution

all you have to call this function:

/////////////

- (void)torchOnOff: (BOOL) onOff
{

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

if ([device hasTorch]) {

    [device lockForConfiguration:nil];

    [device setTorchMode: onOff ? AVCaptureTorchModeOn : AVCaptureTorchModeOff];

    [device unlockForConfiguration];
}

}

Problem

I was not able to find the code to blink the flashlight as it blinks in the Android if any notification comes.

Original source