Netmera Developer Guide
Ask or search…
Comment on page

Sound & Vibration

Sending a Push Notification with Vibration for iOS

When sending a push notification on iOS with any sound selected, the device will vibrate if the vibration feature is enabled in the device settings. However, it's important to note that there is no option within the push notification itself to enable vibration. If vibration is disabled at the device level, the push notification will not trigger 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:

Step 1. Adding Sound Files

For iOS:

  1. 1.
    Add your sound files to the "Library/Sounds" directory within your project.
  2. 2.
    Ensure these files are added at the iOS target level or the application level.

For Android:

  1. 1.
    Include your sound files in the "res/raw" directory within your Android project.
Sound File Formats:
File extensions for sound files must be one of the following: .aiff, .wav, or .caf.
Please keep in mind that custom sounds should not exceed a maximum length of 30 seconds.

Step 2. Web Panel Configuration

After adding the sound file to your project, follow these steps in the web panel:
  1. 1.
    Navigate to Developers -> Sound -> Create New Sound.
  2. 2.
    While creating the sound, use the file extensions in the "Sound FileName" field.
  3. 3.
    Select the desired sound name from the drop-down menu. All items in the menu are sound files whose extensions match the supported push sound extensions (.aiff, .wav, .caf)
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 included in your main bundle; otherwise, the default phone sound will be played when receiving push notifications.

Sending a Push Notification 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.