You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I´ve tried to use:
useEffect(() => {
if (socket.current) {
socket.current.on('msg-receive', (msg) => {
setArrivalMessage({ fromSelf: false, message: msg });
// play notification sound
const audio = new Audio('/notification.mp3');
audio.play();
});
}
}, []);
but It only works if the tab is active
Hi,
How can I get a notification when I receive a new message,
there´s a way to activate this feat.?
The text was updated successfully, but these errors were encountered: