Sound & Vibration
Sending a Push Notification with Vibration for Android
To enable vibration in your Android application, add the following permission to your AndroidManifest.xml file as a direct child of the <manifest> element:
<uses-permission android:name="android.permission.VIBRATE" />Afterward, ensure that vibration is enabled in the "What" tab while creating a campaign.
Adding Custom Sound to Your Project
You have the option to customize push notification sounds for different messages. Here's how to do it:
Include your sound files in the "res/raw" directory within your Android project.
Sound File Formats:
Sound files must use the
.wavextension.Custom sounds should not exceed a maximum length of 30 seconds.
Navigate to Developers > Messaging Assets > Sounds > Create New Sound.
Enter the filename in the Sound FileName field. Use the filename without its extension when referencing the sound on Android.
Use lowercase letters, numbers, and underscores in sound filenames. For example, reference
notification_sound.wavasnotification_sound.Select the desired sound name from the drop-down menu.
Why Does My Notification Play Default Sound?
Exceeding the Limit: If any sound file exceeds the 30-second limit, the default sound of your phone will play instead of your custom sound.
Sound File Location: Ensure that the sound file is in your Android project's res/raw directory. Otherwise, the device plays its default sound.
Sending Push Notifications with Sound
To send push notifications with sound, enable the "Play Sound" option on the "What" tab when creating a new push. If you choose "Default," the device's default sound will play, provided that sound is enabled in the device settings.
Last updated
Was this helpful?