I am implementing an app that uses notifications with the help of Firebase Native and I’m having a hard time placing my custom sound file in the app. Does anybody know where to place it ? I have tried pretty much everywhere with no success.
In android, you should place your file in /platforms/android/res/raw/custom_sound.mp3 and set notification`s sound property value with custom_sound.mp3 like below.
I am using the fcm plugin. but custom sound is not working on android oreo (ios works perfectly). I found that we now need to create a channel in plugin and pass the channel id in the server site. However, I can’t find anywhere in the fcm plugin doc to do the channel. Anyone here know how to do custom sound on android oreo? Thanks
try this before initialising push plugin
var channelId = “emergency”;
this.push.createChannel({
id: channelId,
description: “Emergency Channel”,
importance: 4,
sound: “police_siren”,
}).then(() => console.log(‘Channel created’));
then, my push payload
let pushData = {
registration_ids : ,
data: {
notId: null, // notId on Android needed to be an int and not a string
title: “”,
body: “”,
soundname: “police_siren”,
android_channel_id: “emergency”,
}
}
Hope this will help anyone who still figuring out how.