yes i also do that queue of messages but my main problem is when i try to use 
the contact API with my app(i want to import contacts that are stored on the 
phone and are registered with the service as users) it crashes because im using 
a remote script that links the server my socket.io js on the server stored at 
ip : port / socket . io . js with the client app 

what can i do with this problem?




________________________________
 De: "[email protected]" <[email protected]>
Para: [email protected] 
Enviado: Jueves 19 de septiembre de 2013 19:48
Asunto: Re: [b2g] Socket.io push server and firefox os?
 

On Thursday, September 19, 2013 2:58:02 AM UTC-7, jose llopis wrote:
> i've done a push notification server on nodejs with socket.io and i have some 
> actions like
> 
> socket.on("message",processMessage);
> 
> and inside my processMessage function i 've done
> 
> socket.in("room").emit("sendData");
> 
> my question: 
> 
> i've read that simple push doesnt allow to send messages to push server... 
> 
> so how i can implement my simple push on firefox os to communicate with my 
> nodejs server

On your server, you should maintain a queue of messages for a particular 
client, or just have a common queue of messages and each client keeps track of 
message ids. Then you notify clients using push whenever a new message arrives, 
and they connect to the server and fetch the queue. It is important to remember 
that you should avoid using push when users are actively using the chat and 
frequently sending messages, since there will be more delay rather than just 
using the currently established connection between your server and application. 
It should fall back to push notifications only when you don't have an open 
connection to the client.

Nikhil
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to