4

We have a working app and server that uses C2DM to push messages to Android devices.

Two days ago one of our test devices stopped getting pushes from the server.

  • The deviceRegistrationId the server sends to seems to be updated and correct, the device has a network connection, and google apps using C2DM like Gtalk work properly on it.

  • The server gets a success response from Google's C2DM servers with a proper response of "id=0:133467...61+ac67f...66"

  • The device was accepting pushes properly before then.

  • Our app is live on the market and used daily by lots of users, and we haven't received any similar complaints by users (not that it means it doesn't happen to some of our users)

Any ideas what can be further check to understand this?

Is there a way to use the id received from the C2DM server to check what happened to a specific message?

Thanks.

marmor
  • 27,641
  • 11
  • 107
  • 150

3 Answers3

1

I'm not aware of any reporting to track messages.

The first thing I'd check is that the Registration ID you're sending messages to is still the one the device is using - if they are mismatched that could cause what you are seeing.

I have seen several devices just suddenly stop receiving C2DM messages. In our case, restarting the device usually fixed it.

Another scenario I've seen is devices on particular networks not receiving messages (specifically some wifi networks).

Ollie C
  • 28,313
  • 34
  • 134
  • 217
  • Thanks Ollie, I've checked the deviceRegistrationId saved in our app's prefs and it's the same as the server sends to. Restarting the device didn't work either. The networks used by the device haven't changed, and we've tried it on several different WiFi networks (the device doesn't have a 3G plan) – marmor Apr 18 '12 at 09:51
  • to rule it out, I would try and get that device on a 3G network. We got to a point where we always tested on wifi AND 3G and one some beta testers wifi networks C2DM messages never arrived - a reminder of how important it is that the app has a backup strategy for where C2DM fails (e.g. slow polling) – Ollie C Apr 18 '12 at 09:54
  • Something else I'd try is request another registration ID on the device. It may not help, but it rules that out as an issue. – Ollie C Apr 18 '12 at 09:54
  • I intentionally don't want to re-register the device until we figure this out, since a user won't be able to do this. +1 on the 3G suggestion, we'll try it, but it doesn't sounds good that our users without a 3g plan might be getting these issues – marmor Apr 18 '12 at 10:05
  • 3g didn't solve the issue... any other ideas we might try figuring this out? I'm starting to think to have each device request a ping from the server and if one didn't arrive within an hour, re-register it... i'd REALLY love avoid having this overload on my server and users' devices. – marmor Apr 19 '12 at 14:18
  • My sense is that sometimes things just happen, and if it's a one-off, I'd personally chalk it up to experience, make a note of it, look out for it, and only come back to it if it recurred. It's possible that something weird happened with the records in the C2DM servers. I'd want to re-request the registration ID and see if that resolves it. If your users aren't complaining, maybe it was just a one-off? I've wracked my brains and I can't think of anything you are doing that could cause this, and having spent quite a lot of time with C2DM, I've never seen this issue. – Ollie C Apr 19 '12 at 14:44
  • I'll accept you answer until I have something better, re-requesting the registration ID did work, but it's obviously not a great solution for us. Thanks for helping out! – marmor Apr 19 '12 at 14:48
  • No worries. I appreciate it's incredibly frustrating (and concerning) when an issue occurs and we can't resolve it, but I figure pragmatism is best ;-) – Ollie C Apr 19 '12 at 14:52
0

Authentication Key will change frequently on C2DM server are getting key every time?

  • Thanks Bhaskar, but our server is capable of handling key changes, the server part is working fine, it's able to push messages to our devices. The problem is with the deviceRegistrationId on the device that is somehow not refreshed. Our client side is also capable of accepting new onRegistered calls from C2DM to refresh to deviceRegistrationId but we didn't get any on this device. – marmor Apr 18 '12 at 09:46
  • The auth key does not change frequently. It actually changes very rarely, though many are currently expiring. – Ollie C Apr 18 '12 at 11:07
0

Google is changing its client login expiration policy. They are sending data in a new header to renew the registration I'd and you need to change your code to make this work.

Here is the details: http://android-developers.blogspot.com/2012/04/android-c2dm-client-login-key.html?m=1

Machine
  • 472
  • 3
  • 10
  • Thanks Machine, the client login expiration is on the server side only, our server properly updates the client login when getting the Update-Client-Auth header. Our problem is on the client side, probably with the deviceRegistrationID. – marmor Apr 18 '12 at 10:41