Pavan Jaju
Pavan Jaju

Reputation: 893

GCM : Message delivered only while debugging

I am stuck with an issue.

I am developing an application which is using the GCM push notification functionality. While debugging all the messages are getting delivered(with/without some amount of varying delays) to the device. But when I unplug the device from the PC or disable debugging mode GCM messages are not getting delivered (I actually waited for more than 3 hours with active internet connection and google account).

And again when I plugin the device back to PC and enable USB debugging it starts receiving GCM messages.

Guys I am really scratching my head hard to get pass this weird issue. Can you please give me some direction or correct me if I am missing something.

Thanks in advance.

Upvotes: 1

Views: 1080

Answers (1)

Pavan Jaju
Pavan Jaju

Reputation: 893

Hey after wasting my whole day on this question I came across a line which I wrote for debugging the IntentService

android.os.Debug.waitForDebugger();

this was the line responsible for all the above weird behavior. It might be obvious to remove or not to use this line (I would like to apologies if it is the case for wasting your precious time). But it might help someone like me in the future (at least I can say so... :P).

Anyways thank a lot for your timely responses.

Upvotes: 2

Related Questions