I want to play audio like whatsapp web push notification or telegram web notification. I already able received push notification in service worker, the problem is how to play audio when push notification received ?
I already read the documentation of Notification API on here :https://developer.mozilla.org/en-US/docs/Web/API/notification/sound
Based the documentation, Notification have parameter Sound (Notification.sound) .
I already implement that parameter to my syntax :
self.registration.showNotification(title, {
body: body,
icon: icon,
tag:tag,
data: data,
sound: 'http://127.0.0.1/myfolder/audio/alert.mp3'
})
But still can't play the audio when receied push message in service worker, how to make play ?
Thanks.