Custom sound for receiving notification

Vic 1 Reputation point
2021-04-08T06:01:30.147+00:00

I am getting push notification in background mode and in killed mode as well but I am not able to play the custom sound which is defined in the notification payload body in background and killed mode.

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
300 questions
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,031 Reputation points Microsoft Employee
    2021-04-09T01:19:11.37+00:00

    Hi @Vic ,

    Forgive me I misunderstood your question, but I don't believe your notification message could (or should) contain the payload for the actual sound. The sound should be an asset in your app package.

    I did see https://stackoverflow.com/a/43284214/10987310 which contains a code snippet of how to play a custom sound with a notification. If you include the name of the sound file in the payload and use it to make the resource Uri.

    Regards,
    Ryan

    0 comments No comments