danielrhodes / Swift-ActionCableClient

ActionCable is a new WebSocket server being released with Rails 5 which makes it easy to add real-time features to your app. This Swift client makes it dead-simple to connect with that server, abstracting away everything except what you need to get going.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear channels

allaire opened this issue · comments

Is there a way to clear autoSubscribed channels, let say when a user sign out? I can disconnect the websocket, but when I reconnect it when the other user log in, old subscriptions remain. Note that I'm using a Singleton ActionCable Manager, so maybe I should just reset the singleton instance?

Hey @allaire, Did you try yourChannel.unsubscribe() ?

@mansi-cherry Yeah I finally made a ActionCableManager class, and manage an array of subscriptions. When the user signs out, I loop and unsubscribe each channel.