PubNub vs C2DM

bluedude

Well-Known Member
Licensed User
Longtime User
Tested C2DM a few times but not sure about quotas and limitations.

This scares me a little:

Are you using C2DM for payload? C2DM is meant as a means to notify your application that there are messages available for it. You should not carry your data payload through C2DM. Instead, consider adapting your design so that the C2DM message causes your application to connect to your servers in order to retrieve the pending messages.

Are you sending C2DM messages too frequently? If you need to communicate with your application frequently over a short period of time, C2DM is probably not the best solution. Instead, consider implemeting XMPP or your own protocol to exchange messages, and use C2DM only to send the initial notification.

It is very unclear what scalability C2DM offers and when you need to pay or better, is there actually a way to get more messages?

What about PubNub? Seems to be a better solution.

https://github.com/pubnub/pubnub-api/tree/master/android

Not sure how much work it would be to create a wrapper.
 

warwound

Expert
Licensed User
Longtime User
But look at this page: https://pubnub.zendesk.com/entries/21167293-can-i-use-pubnub-for-free

Q: What are the limitations of the free tier of PubNub?

A: The free tier of PubNub is granted immediately upon sign up. With the free tier, you get full API access (sans optional add-on features).

Deploying your application is limited as follows:

Up to 1 million messages per month
Up to 100 peak connections (up to 250 peak connections for non-profit organizations)

You will get notified to upgrade to a paid account when your application exceeds the above usage limits.

And this page defines a 'peak connection': https://help.pubnub.com/entries/21167953-how-are-peak-connections-counted

As a free service it's very limited it seems.

Martin.
 
Upvote 0

cbal03

Member
Licensed User
Longtime User
Pubnub Library?

I couldn't find more suitable place to post so I'll post my question here. Sorry if this is the wrong place.

I want to use pub nub for notifications to my app.

Are there any plans for making a library to support pub nubs push service? I'm not experienced with Java.

Thanks!
Chris
 
Upvote 0

cbal03

Member
Licensed User
Longtime User
The most notable advantages are:

Items are received very fast and in the order they are sent.
items are received more reliably according to some tests i performed quite a while back.

Testing C2DM:
server side, I sent messages from a loop (php) to my device. The device displayed and logged the messages received. The log showed some quantity of missed messages (some were not in the correct order as well) every time the app was started an an let run for a while.

Testing Pubnub:
server side, I created channels in a loop. On each channel i sent some quantity of msgs and logged them.

In my web browser i could view the list of channels currently available and clicking on them displayed the messages sent. All messages were received correctly and without having to refresh the page.

This was quite a while ago. I'd have to do some digging to set it up again if needed.

Chris



More info. I posted a new thread with some information about pubnubs services. I hope I put it in the right place. I'm very eager to get this msg'ing system going in my app. :)
 
Last edited:
Upvote 0

cbal03

Member
Licensed User
Longtime User
The new GCM service appears much better than the previous C2DM. There is a 20 msg limit per device though then I have to either wait a few minutes or toggle airplane mode(off then on) on the devices to resume exchanging messages up to another 20.

On wifi and 3G all 20 messages are received immediately after the sending of each.

Can this 20 msg limit be overcome?

I want possibly thousands of devices to be in communication with each other (in pairs) at any given time using my single API key. Would GCM be a viable solution for this situation?

Many thanks.
 
Upvote 0

cbal03

Member
Licensed User
Longtime User
GCM is not suitable for this situation (as many might try to use it).

Your app starts for the first time, registers a unique id with GCM then notifies your own server, through HTTP, that the device is online.

Then.. your own server sends the device a msg through GCM...

What happens..

The device will wait for the msg. I have found that it waits no less than 3 minutes and sometimes up to 15 minutes before receiving. That is if it receives the message at all. I can poke it by toggling airplane mode to get the messages flowing. It seems to me that GCM is for general notifications like "hey! An update is available at such and such URL". But that's all.

I couldn't find a way to get past the 20 msg limit. The GCM docs suggest you can by turning on billing. But the console doesn't have any way to turn on billing for GCM. The dev forums weren't responsive either.

There really was no need to get past the 20 msg limit in order to find out if the service was even remotely viable for the aforementioned situation anyway.

I hope this info helps someone out there.
 
Upvote 0
Top