Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all channels associated with a PubNub subscribe key

Tags:

pubnub

Is it possible to get all the channels associated with a Pubnub subscribe key? All channels that were ever created using this key?

Thanks,

like image 206
jm. Avatar asked Oct 18 '25 12:10

jm.


1 Answers

You can get a list of all channels that are actively subscribed to using a Global Here Now call - http://www.pubnub.com/docs/web-javascript/presence#gobal_here_now

There is no option to get a list of channels that were "created" in the past but are not active now. Here are a couple of alternatives that could work for you.

Stream Controller (Channel Groups)

With channel groups, you can manage subscriptions to channels centrally. By assigning a channel group to each user, you can list all channels (active or inactive) that were added to their channel group. PubNub maintains the subscription list for all channel groups and here's how you will retrieve them

http://www.pubnub.com/docs/web-javascript/stream-controller#listing_channels_within_group

Presence Callbacks

PubNub allows you to specify a HTTP callback URL that is triggered when a channel becomes "active" or "inactive". This way, your server will be notified whenever a channel is "created" and you can persist that information to a database so you can query at a later time.

like image 182
Girish Dusane Avatar answered Oct 22 '25 05:10

Girish Dusane