Support Topics Documentation Slack YouTube Blog

Specific sound when sending push-notification to individual device(s)


How to specify sound and icon when sending push-message to individual device as in example below?

Hi @Maria_Kudriashova

Do you send the notifications from a Push Template or use a basic approach?

Best Regards,

As I know, targeting individual device by sending notification from push template is not possible.
That’s why I am using the example provided by a link in the question.

You can set the custom notification sound following these steps:

  1. Locate your sound in the raw resource directory. For example: /app/res/raw/mysound.mp3.
  2. Add the custom header with the name of your sound (without file extension):
    publishOptions.putHeader("android-content-sound", "mysound");
  3. Send the notification with defined publish options:
    Backendless.Messaging.publish("Message", publishOptions, deliveryOptions)

Small icon for the notification can be set only from Push Template. Here is the example how to do it:

Also we will release the new version soon that will allow to send the push notifications to individual devices.

Best Regards,