Sockets vs Push notifications

79 views
Skip to first unread message

Mario Barón

unread,
Oct 15, 2014, 5:37:21 PM10/15/14
to codenameone...@googlegroups.com
Hey guys, 


I have a question, what are the benefits of using Push notifications over the Sockets implementation provided by the CN1Sockets lib while needing to maintain a constant connection to my server? is it viable to use sockets over push notifications if what I need is the connection between client-server to be as reliable as it can possibly be? I also receive any suggestions on how I can better implement this connection since my app should have a connection which should garantee that no messages are lost and they arrive almost immediately.


Thanks.

Shai Almog

unread,
Oct 15, 2014, 9:00:26 PM10/15/14
to codenameone...@googlegroups.com
Hi,
you can also use http://www.codenameone.com/blog/fast-push-communication-using-pubnub

These are VERY different use cases. Push provides alerts/badges when the application is in the background to promote engagement, it doesn't deliver any "real" payload.
Pubnub or persistent sockets are designed to run while the app is actively running.

Mario Barón

unread,
Oct 16, 2014, 9:18:42 AM10/16/14
to codenameone...@googlegroups.com
Hey Shai,

thanks for your response. So following this line of ideas, would it be a good idea to use a mixture of both tehnologies to get an even more reliable communication? (Push for notify and get the user to open the app and once it's open use sockets to listen to the information). 

Would this be better and more reliable than using Push notifications and web services? I'm open to suggestions on this subject.



Thanks.

Shai Almog

unread,
Oct 16, 2014, 9:57:25 PM10/16/14
to codenameone...@googlegroups.com
Hi,
yes.
In fact one of the things we would like to offer is a framework to allow just that.
Reply all
Reply to author
Forward
0 new messages