Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make iPhone vibrate: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) undeclared

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?

like image 314
Ben Lu Avatar asked Jun 10 '12 16:06

Ben Lu


1 Answers

Try:

AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);

EDIT: Also make sure you import AudioToolbox.framework

  • #import <AudioToolbox/AudioToolbox.h>
like image 108
skram Avatar answered Oct 18 '22 08:10

skram