I'm working on an app that calls AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
from a loop in a separate thread launched with performSelectorInBackground
. For some reason, the app only vibrates reliably when the entire app is running in the background. I tried calling the vibrate function from a block sent to the main NSOperationQueue, but it's still only consistent when in the background. Unless, of course, I throw a NSLog()
call into the operation block:
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
NSLog(@"VIBRATING");
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
}];
With the NSLog call, it runs as intended regardless of where it's running.
Any idea why this is? All suggestions are much appreciated