Reputation: 1059
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.
In the file you intend to trigger a vibration, import the AudioToolbox header file:
#import <AudioToolbox/AudioServices.h>
Finally, call the following line to make the device vibrate:
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
Is there anything, I missed......... Thanks....
Upvotes: 2
Views: 2246
Reputation: 199
I import this framework AudioToolbox/AudioToolbox.h
and call
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
try it.
Upvotes: 2
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