How can I prevent multiple tabs opening new Channels connections?

Service Workers can be used to help prevent a high connection caused by users opening your app in multiple browser tabs. This blog post details how to use pusher-js in a Service Worker, inlcuding providing some sample code and a GitHub repo.

However, it isn't possible to receive messages using Pusher while the web worker isn't running (e.g. no app tabs open). To do that, you would probably need to make use of the web Push API.

Was this article helpful?
0 out of 0 found this helpful
Haven't found what you were looking for?
Submit a ticket