Hello everyone!
I’m using @ionic/vue (7.0.0), @capacitor/cli (5.0.5), @capacitor/push-notifications (5.1.0)
- I’ve created a channel:
PushNotifications.createChannel({
id: "fcm_default_channel",
name: "My notification channel",
sound: "bark.wav",
importance: 5,
visibility: 1
})
.then(() => {
alert("push channel created: ");
})
.catch((error) => {
alert("push channel error: " + error);
});
- Added my bark.wav into app/src/main/res/raw folder
- Send message using firebase-admin/messaging:
const notification = {
title: "Hey there!",
body: "Hello from Canada!",
}
const message = {
notification,
android: {
notification: {
...notification,
channelId: 'fcm_default_channel',
sound: 'bark.wav',
}
},
token,
};
getMessaging()
.send(message)
.then((response) => {
console.log("Successfully sent message: ", response);
})
.catch((error) => {
console.log("Error sending message: ", error);
});
But it doesn’t work. I don’t hear bark.wav or default sound. Sound is absolutely absent.
I would be grateful for any assistance,
Best regards!