- Home /
Custom push notification sound in android build doesn't work
I am building a Unity android application that implements GCM push notifications. The push notification is arriving fine but the custom sound won't seem to play. I have placed the custom sound file in the directory Assets/Plugins/Android/res/raw/notification_sound.wav and when I built the app and sent a push the default device notification sound played instead of my custom one. I am sending the GCM request via parse cloud code.
The GCM data object:
{
method: 'POST',
url: 'https://gcm-http.googleapis.com/gcm/send',
headers: {
'Authorization': authorizationKey,
'Content-Type': 'application/json'
},
body: {
"registration_ids" : deviceTokens,
"priority" : "high",
"data" : {
"ticker": "Game invitation",
"content_text": senderName + " has invited you to a private game of Checkers!",
"content_title": "Game invitation from " + senderName,
"sound": "notification_sound"
}
}
}
I have also tried using "sound":"notification_sound.wav" without success.
The device is running Android version 6.0.1 and the build was on Unity 5.5.0f3.
Thanks in advance for anyone willing to help :)
(Link to stackoverflow question: https://stackoverflow.com/questions/43660579/custom-push-notification-sound-in-unity-android-build-doesnt-work)
Your answer
Follow this Question
Related Questions
Application crashes when notification received:android 0 Answers
Help with the new Mobile Notification System in Unity 1 Answer
Free Android local notification plugin 1 Answer
Firebase Cloud Messaging notifications 1 Answer
[Android, GCM] How to display notification when receiving the message from our server? 3 Answers