0
votes

I'm trying to send clevertap push notification with custom sound. I have added the sound files to the path "/Users/Per/ProjectNa/android/app/src/main/res" of react native android project. Notification with default sound is working but trying to the send the notification with custom sound (eg:alarm_sound.mp3) is not playing the sound. I'm receiving the notification without sound. Not sure what is happening. Please let me know where I am going wrong.

File Names Eg: alarm_sound.mp3, tower_clock_sound.mp3

1

1 Answers

1
votes

The CleverTap SDK looks for the sound file in the raw folder in your app and not the res folder. Please take a look at this documentation where it is explained on how to add sound files to your app so that they can be used for push notifications.

If you want custom sounds to work for Android Oreo and above then create a notification channel to which you will be sending the push notifications in the following manner in your JS file -

CleverTap.createNotificationChannelWithSound('YourChannelId','YourChannelName','YourChannelDescription',3,true,'name_of_sound_file.mp3');

Please make sure the sound file is present in the raw folder of your app according to the documentation link provided above.