Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence Channel userInfo not available? #67

Closed
wilsonfan opened this issue Dec 22, 2013 · 2 comments
Closed

Presence Channel userInfo not available? #67

wilsonfan opened this issue Dec 22, 2013 · 2 comments

Comments

@wilsonfan
Copy link

From the docs (http://pusher.com/docs/authenticating_users#/lang=py-gae) it says that you can add user info to the auth response. It should be accessible in client via

presenceChannel.bind('pusher:subscription_succeeded', function() {
  var me = presenceChannel.members.me;
  var userId = me.id;
  var userInfo = me.info;
});

http://pusher.com/docs/client_api_guide/client_presence_channels#pusher-member-added

However it seems that the userInfo is missing for the user (always null). Looking at presence_channel.js line:34 it only saves the channelData.user_id and nothing else. Is this a bug and should it save the userinfo as well? or did I miss something?

Thanks for your help

@pl
Copy link
Contributor

pl commented Dec 23, 2013

Everything works for me, we've got integration tests for presence channels. The method on line 34 only sets the connection's ID and the data is assigned when the subscription event is received from Pusher:

https://github.com/pusher/pusher-js/blob/master/src/channels/presence_channel.js#L48
https://github.com/pusher/pusher-js/blob/master/src/channels/members.js#L44

If the member's info is sent correctly to Pusher, it should be accessible via members.me. Are you sure you are responding from auth in a correct format?

@wilsonfan
Copy link
Author

Thanks for the prompt reply, I had another look at the auth code as you have suggested. And you're absolutely right, the formatting was off hence info was not populated.

Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants