In order to cause the user to notice the warning, often accompanied by sound vibration and so on. The system Sound service provides an interface for playing a sound file that does not exceed 30 seconds, and the format he supports is caf,aif,wav.
iOS uses this API to support 3 different notifications:
Sound: Play a simple sound file immediately, if the phone is muted, the user can hear nothing.
Reminder: Play a sound file, if the phone is set to mute or vibrate, the user will be alerted by vibration
Vibration: Vibrate the phone without considering other settings
First import the framework: Audiotoolbox, an excuse file for importing the framework into a file: #import <AudioToolbox/AudioToolbox.h>
Add three buttons to the Xib file to achieve the above three functions respectively. Put a sound file in a WAV format
Voice
Warning
Vibration
ios-hardware sound, vibration, prompt warning