Closed arochedy closed 2 years ago
Are you attempting to share data from the web worker to your app?
What error are you receiving?
Have you tried client.postMessage("test");
?
Yes I want to share data from the web worker to my app : do you know how to do it ?
It's looks like client.postMessage("test"); doesn't work I have "client is undefined"
I tried
_currentSelf.clients.matchAll().then(c => {
c[0].postMessage("test");
console.log(c[0]) })
But I don't have client
Are you able to try the below?
self.clients.matchAll().then(all => all.forEach(client => {
console.log('sending message');
client.postMessage(payload.data);
}));
I have not been able to replicate the issue here. Do you have a tab open on your site when receiving the notification?
I'll close this out as it looks to be related to generic web worker implementation and not this specific library. If you have a specific issue with Pusher Beams feel free to open a new issue or get in touch at https://support.pusher.com/hc/en-us/requests/new
Hi,
I wan to call postmessage web worker function but it doesn't work.
I tried
and
and
but none is working 😭 How can I interact from the web worker to the main app ?
Thank you