Adding custom sounds to mobile notifications.
AwesomeSound.wav
use awesomesound.wav
or awesome_sound.wav
.Platform | Extensions | Notes |
---|---|---|
iOS | .wav .aiff .caf | Sounds must be encoded as Linear PCM, MA4 (IMA/ADPCM), Β΅Law, or aLaw. Must be less than 30 seconds. |
Android | .wav .mp3 .ogg | Recommended length less than 30 seconds. Keep file size small, large files may not play on some devices. |
Huawei | .wav .mp3 .wma | Recommended length less than 30 seconds. Keep file size small, large files may not play on some devices. |
Amazon | .wav .mp3 .ogg | Recommended length less than 30 seconds. Keep file size small, large files may not play on some devices. |
SDK | Folder |
---|---|
iOS Native | Add files to the Xcode project root. Make sure Add to targets is selected when adding files so that they are automatically add to the bundle resources. |
Cordova, Ionic | Add files to Resources directory within the Xcode project in <project-root>/platforms/ios/project-name.xcodeproj . |
Unity | Add sounds anywhere in your Unity project, build your project, and then move those sounds to the Xcode project root. |
explode_sound.wav
. Set in the dashboard when sending push messages or use the Create Notification API ios_sound
property.For no sound, pass in nil
to the Sound field.Can I set a default sound?
Why is my notification not playing the custom sound file?
res/raw/
.If shrinking resources is enabled, you can protect sound files from being removed by creating keep.xml in res/raw/ with following codeWhy is my notification playing the default sound file?
Why is the wrong sound playing?