vendredi 21 octobre 2016

how do i access the list of people subscribed to a channel?

so i'm trying to iterate through the members of a pusher presence channel, the pusher documentation says this can be done by

pusher.members.each(function (member){ console.log(member); });

but i'm getting an error in my console

Uncaught TypeError: Cannot read property 'each' of undefined(…)

i even tried typing presence.members.count in the console, it returns the same error as above. the pusher js library is properly linked and the loop is triggered when the subscription to the presence channel is successful.

please what am i doing wrong? and why am i getting this error?




Aucun commentaire:

Enregistrer un commentaire