ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.31k stars 206 forks source link

Persistent connection and upstream messaging over CCS #109

Open hypesystem opened 9 years ago

hypesystem commented 9 years ago

CCS allows for a persistent connection between server and client. https://developers.google.com/cloud-messaging/ccs

Upstream messaging (the server receiving messages from the clients) depends on CCS, and is the primary reason for implementing this.

I expect this to be a big change to implement (hence no milestone yet).

ericdolson commented 9 years ago

This would be awesome to have added to your library. Benchmarking this for one registration id at a time I get about 300/second where apn gives me about 15000/second to iOS devices since it uses a persistent connection. I know I can bulk-send up to 1000 pushIds with your module over https, but when I personalize the messages this no longer works because the payload changes per target device. Please consider adding this. The performance gains would be incredible.

rolivav commented 8 years ago

+1 to this!

pzienowicz commented 8 years ago

What is the status of this feature? I want to use this library but I need to use upstream messages.

eladnava commented 8 years ago

@hypesystem How hard is this to implement? Can you summarize the tasks and changes involved?

I imagine this being a new API call in sender.js that receives a callback (or event emitter?) and calls it whenever a device has sent an upstream message.

hypesystem commented 8 years ago

The project has not yet been started, and this would require implementing a connection to an entirely new API. In addition, it would introduce concerns that we have not even considered yet (like a persistent long-running connection, instead of discrete HTTP connections for each call).

I don't have an overview of exactly what would need to happen, but it seems like a big addition :smile:

If anyone has time for it, I would recommend making a new branch explicitly for developing this interface, and I would love to review everything you do. Unfortunately, however, this is not a feature that is high on my own list.

kzahel commented 8 years ago

i needed upstream messaging and tried this but then realized this is just using the http protocol. there's a node project with xmpp/upstream support: https://github.com/jacobp100/node-gcm-ccs it seems to work.