0

I want to vibrate and flash light simultaneously.But when I Use following code i only get flash light.

if (some condition)
{
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    [self setTorch:YES];
}

But when i use only

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

my phone vibrates.

I am unable to find the issue.

Jasper
  • 7,031
  • 3
  • 35
  • 43
Sid
  • 79
  • 11

1 Answers1

0

May be it will useful for you

find this Gonna Vibrate the device to alert the user? Read this first

Both the functions vibrate the iPhone. But when you use the first function on devices that don’t support vibration, it plays a beep sound. The second function on the other hand does nothing on unsupported devices. So if you are going to vibrate the device continuously, as a alert, common sense says, use function 2.

AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
Community
  • 1
  • 1
Mathi Arasan
  • 869
  • 2
  • 10
  • 32