PDA

View Full Version : Make iPhone vibrate




justinm
Nov 28, 2008, 08:35 PM
Hey Everyone-

Trying to make my first iPhone app here. Need some basic help.

I am trying to make a very simple app just for myself that has a simple interface. There is one button, which is supposed to make the phone vibrate. I read on the iPhone Dev Center that I need to make a Audioservices.h file which I did. I am having a hard time understanding where to put the code. Here is where I saw the info. http://developer.apple.com/iphone/library/codinghowtos/AudioAndVideo/index.html#PLAYBACK-TRIGGER_VIBRATION_IN_IPHONE

If you need any files from me, just let me know.



vavdiyaharesh
Nov 29, 2008, 04:25 AM
i think that there is sample code is available in iphone dev center and it name is SysSound........

bnut
Nov 29, 2008, 10:36 PM
Hey Justin, you're not the only one wondering this, someone was asking the exact same thing at a conference I was at the other day. My understanding is that you can prompt the iPhone to make the standard vibration by calling AudioServicesPlayAlertSound with the correct constant.

If you check your iPhone docs for that entry it should have the constant. As for custom vibrations, as far as I know it is not exposed.

MalathiV
Dec 5, 2008, 06:24 AM
Hey Everyone-

Trying to make my first iPhone app here. Need some basic help.

I am trying to make a very simple app just for myself that has a simple interface. There is one button, which is supposed to make the phone vibrate. I read on the iPhone Dev Center that I need to make a Audioservices.h file which I did. I am having a hard time understanding where to put the code. Here is where I saw the info. http://developer.apple.com/iphone/library/codinghowtos/AudioAndVideo/index.html#PLAYBACK-TRIGGER_VIBRATION_IN_IPHONE

If you need any files from me, just let me know.

Try the link Below,
http://developer.apple.com/iphone/library/samplecode/SysSound/index.html