Programmatically make the iPhone vibrate

Sam Jarman picture Sam Jarman · Jan 17, 2010 · Viewed 24.7k times · Source

Possible Duplicate:
Making the iPhone vibrate

How can you programmatically make the iPhone vibrate?

Any ideas, or tutorial links appreciated.

Answer

Henrik P. Hessel picture Henrik P. Hessel · Jan 17, 2010

You can use

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 

Note that you need to add the AudioToolbox framework and import the following header file:

#import <AudioToolbox/AudioServices.h>