Comments (12)
Hi alsonkemp,
We're working on a feature with this functionality that will be released soon. Thanks!
from now.
Hi @alsonkemp,
I've just built this feature.
use it as follows:
nowjs.getClient("some-client-id", function(){
this.now.whatever():
// this.user.clientId == "some-client-id" // true
});
from now.
Can someone write a simple example to send a message to a client id?
from now.
nowjs.getClient(clientId, function(){
this.now.someFunction();
});
Eric
On Mon, Jun 13, 2011 at 9:07 PM, amitda <
[email protected]>wrote:
Can someone write a simple example to send a message to a client id?
Reply to this email directly or view it on GitHub:
#33 (comment)
510-691-3951
EECS Student at UC Berkeley
http://ericzhang.com
from now.
Thanks Eric.
Is there a way of integrating this into multi-room chat example?
from now.
Yep it can definitely be integrated but the multi-room chat example does not have any of the user interface necessary to integrate it.
from now.
I am working on it now... if I am successful, I will upload it here
from now.
Great to hear! Let me know if you need further help.
Eric
On Mon, Jun 13, 2011 at 9:23 PM, amitda <
[email protected]>wrote:
I am working on it now... if I am successful, I will upload it here
Reply to this email directly or view it on GitHub:
#33 (comment)
510-691-3951
EECS Student at UC Berkeley
http://ericzhang.com
from now.
Hello,
Is there an error callback function on now.getClient in case the socket is closed or does not exist ?
Thanks a lot,
Luc
from now.
Is there a best practice on knowing which clientId to use with getClient? Should we use a userID that already exists? Pull the clientID from the socket.io (and if so, any examples how best to)?
I'm trying to implement a multi-room chat session, where users can join and leave rooms, but still missing exactly how to tell a group that a user should be added or removed from a room.
from now.
Hi Jay,
The best way is to use the this.user.clientId
which is available whenever
this.now
and this.user
are available.
One way to do what you describe i using the join event
mygroup.on('join', function(){
mygroup.now.notify(this.user.clientId + ' has joined');
// this.user.clientId can also be stored for use in nowjs.getClient later
});
On Wed, Sep 28, 2011 at 4:52 PM, Jay Crossler <
[email protected]>wrote:
Is there a best practice on knowing which clientId to use with getClient?
Should we use a userID that already exists? Pull the clientID from the
socket.io (and if so, any examples how best to)?I'm trying to implement a multi-room chat session, where users can join and
leave rooms, but still missing exactly how to tell a group that a user
should be added or removed from a room.Reply to this email directly or view it on GitHub:
#33 (comment)
510-691-3951
EECS Student at UC Berkeley
http://ericzhang.com
from now.
Awesome, that helped alot. I was googling it but not quite understanding until you gave me that hint. I've now got groups working across all my rooms, with the group being joined by the client, but verified that they have membership by the server and then aligned to the group._id from the database. Yay!
from now.
Related Issues (20)
- installation fail :( HOT 3
- Can not read the property of 'ressource' undefined HOT 1
- No dev in six months. What is the future of NowJS? HOT 13
- Now module Installation failed ..... throwing error in windows
- npm install now ..... throwing error HOT 1
- Not working with Dojo due to Socket.io-client
- Implementing chat module by using Nowjs HOT 6
- now.js and node autocluster core module
- Issue in limit of sending message in chat
- /nowjs/now.js ??
- website HOT 7
- Connecting to nodejs on http from https site HOT 1
- cannot finde module '../build/Release/nodeproxy.node'
- iOS app crashed in release mode while using Nowjs library
- Now doesn't work with latest sockets.io HOT 2
- Does not work with angular-cli: content.charCodeAt is not a function
- possible spam HOT 1
- Error: Cannot find module 'now' HOT 3
- Error: Cannot find module 'now'
- http://www.nowjs.com is not correct HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from now.