views:

699

answers:

2

How can you programmatically make iphone vibrate?

Any ideas, or tutorial links appreciated.

Thanks,

Sam.

+10  A: 

You can use

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 

Declared in AudioServices.h

Other great iPhone examples: http://www.iphoneexamples.com/

Henrik P. Hessel
do you need to put anything else? i tried this, and got several build errors. and can you do this multiple times?
Sam Jarman
@Sam: You need to `#import` the appropriate headers and link to the relevant frameworks.
KennyTM
Right-Click the Method and selecting "Find in documentation"
Henrik P. Hessel
ah. got it. [15 characters.. wtf!]
Sam Jarman
Pretty dumb.... (the 15 char. minimum)
George Edison
hey guys is it possible to vibrate when the iphone is not on vibration(silent).
BK
+3  A: 

lots of good stuff already on stackOverflow too: http://stackoverflow.com/search?q=iphone+vibrate

darren