umakanta
umakanta

Reputation: 1059

ksystemsoundid_vibrate not working in iphone4 and ipad

In my application,I need vibration while wrong password is being entered by the user.

My device OS : iOS5

It is vibrating in iPhone3G but not vibrating in iPhone4 and iPad.

I have followed this steps:

1.Added the AudioToolbox framework to my Application.

  1. In the file you intend to trigger a vibration, import the AudioToolbox header file:

          #import <AudioToolbox/AudioServices.h>
    
  2. Finally, call the following line to make the device vibrate:

         AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
    

Is there anything, I missed......... Thanks....

Upvotes: 2

Views: 2246

Answers (2)

Fadia Jaradat
Fadia Jaradat

Reputation: 199

I import this framework AudioToolbox/AudioToolbox.h and call

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

try it.

Upvotes: 2

hwlau
hwlau

Reputation: 75

I was trying to make the vibration api works in my iphone5 and I found out that it won't work if the vibration settings have been off. (Goto System Settings \ Sounds => Vibrate on Ring.)

Upvotes: 6

Related Questions