Make iPhone vibrate

Discussion in 'iOS Programming' started by justinm, Nov 28, 2008.

  1. macrumors member

    Joined:
    Aug 15, 2007
    Location:
    Orlando FL
    #1
    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.
     
  2. macrumors newbie

    Joined:
    May 15, 2008
    #2
    i think that there is sample code is available in iphone dev center and it name is SysSound........
     
  3. macrumors newbie

    bnut

    Joined:
    Nov 16, 2008
    #3
    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.
     
  4. macrumors newbie

    Joined:
    Nov 25, 2008
    #4
    Try the link Below,
    http://developer.apple.com/iphone/library/samplecode/SysSound/index.html
     

Share This Page