Monday, 17 April 2017

How to get user id using username in socket io

I am using socket io for chat application. My side is using android. I want to get the particular id. When i have sending the username. I want to show the user id. I have use the shown below.

 const userId = user.userId;
 const user1 = usernames[userId];
 console.log("user1 :"+user1);

But it shows only the username how to show the user id or how to get the user id. Please help me?



via Fazil

No comments:

Post a Comment