Make iPhone vibrate: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) undeclared
17,740
Try:
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
EDIT: Also make sure you import AudioToolbox.framework
#import <AudioToolbox/AudioToolbox.h>
Author by
Ben Lu
Updated on June 26, 2022Comments
-
Ben Lu almost 2 years
I want to make iPhone vibrate and I found the code
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
but Xcode 4.3.2 reports error: undeclared identifier kSystemSoundID_Vibrate
What's the problem?
-
Ben Lu almost 12 yearsSame error and there's no AudioServicesPlayAlertSound() method. Is it right to add AudioToolBox.framework?
-
Babul over 11 yearsHi, can we make the iPhone Vibrate 2 times with the above one ? @skram
-
user2899094 almost 4 yearshow do you set the duration of the vibration using this method?