Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCM duplicated messages

I have an app based on Google Cloud Messaging and it was working well. Now (today) all of a sudden it started having a problem we've never seen before. For each message sent between devices, the receiving device will get it twice. The first will arrive almost instantly (within less than 3 seconds of sending). The second arrives a few minutes later. There are two devices in the test, the problem is the same whichever one is the sender/receiver. So if a device sends a few message to the other, the other will get them pretty much instantly--but then at a later time, it will receive a barrage of messages which are the second copies of the messages it has received.

I have put in breakpoints to make sure that the sending device wasn't the culprit: the message was sent exactly once (i.e. the web service for sending was called exactly once--and the code for the backend, which runs on Google App Engine, hasn't changed for ages.) However, the message somehow gets delivered to the receiving device twice. By using breakpoints I also made sure our own code on receiving side isn't responsible: it is verified that GCMIntentService::onMessage() indeed gets invoked twice for each sent message.

We also made sure the registration id in our database is the latest. At this point I'm stumped and need ideas to make any further progress. So any ideas?

like image 565
user2113392 Avatar asked Feb 27 '13 00:02

user2113392


People also ask

What is GCM service on Android?

Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.

Is GCM reliable?

We evaluate GCM in real world experiments, and at a reasonable scale involving thousands of real users. Our findings reveal that the GCM message delivery is unpredictable, namely having a reliable connection to Google's GCM servers on the client device does not guarantee a timely message arrival.

What is GCM in Mobile?

Google Cloud Messaging (GCM) is a service developed by Google and used by developers to send data from their servers to Android applications installed on Android devices.

What is GCM notification?

Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the ...


1 Answers

https://groups.google.com/forum/#!topic/android-gcm/EHZUTEJMeyw

Check the official GCM thread above. Everyone is experiencing this issue. Google's fault!

like image 200
John Avatar answered Oct 09 '22 03:10

John