Vibrate iPhone for specified duration

1.8k views Asked by At

I would like to be able to vibrate the iPhone for a specified duration. Using the AudioToolbox framework, it will vibrate for about 2 seconds, when I use this code:

AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

This does the job, but I'd rather vibrate for a shorter (or longer) duration depending on how the user performed the action, not to mention the benefits this could offer to game developers.

Thanks for any ideas.

1

There are 1 answers

1
tomislav On BEST ANSWER

You could set a NSTimer or a for loop that would set off a vibration every two seconds and make it seem like a long vibrate. Not sure if Apple would allow this tough.