-
Notifications
You must be signed in to change notification settings - Fork 21
How to use custom notification sound?
For playing custom sounds, make sure you have sound file in your application project to be able to target it by sending a message.
Check the cases when your custom sound won't be played.
Place custom sound files in your app bundle (e.g. drag & drop file in XCode) or in the Library/Sounds
folder of your app's container directory (if the folder does not exist, create it).
Apple's official docs on how to prepare a sound file.
You should provide .sound
option as userNotificationType
parameter while integrating your app with Mobile Messaging SDK.
In order for custom notification sound to be played by the OS, you need to send message by API with the name of the sound (with extension) by using soundName
parameter in notificationOptions
.
IOS notifications are delivered along with playing the default alert sound. Default sound is played if:
- custom sound name isn't set in send message API request
- sound file targeted by API is not found by the provided name (e.g. valid name:
my_sound.wav
, e.g. invalid name:my_sound
) - sound file is not valid - cannot be longer than 30 seconds or is of wrong extension (supported file formats: .wav .aiff .caf)
NOTE: Prerequisite for playing any sound is that sound is enabled for device and for your application.
If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
Geofencing serviceDEPRECATED- Privacy settings
- In-app chat
- WebRTC Calls and UI