nikki
nikki

Reputation: 3228

GCM Messages not being received sometime

Friend, I am working with a chat application. In my chat application I am using GCM for push notification. GCM is working fine with my application. But not all time I am not able to get GCM message. Sometime I receive GCM message and sometime don't. Why so? I searched for GCM message failure but did not find the right one.

Anyone, can please help me?

Upvotes: 2

Views: 4272

Answers (3)

Jigar
Jigar

Reputation: 791

If you are using your mobile internet through any firewall like "Cyberoam" or something like that then it restricts ports for the GCM push notification .Try to implement it using Direct internet connection without any firewall. This Solved Probelem for me. I hope it will help you too.

GCM requires port number 5228, 5229, and 5230 to be open. GCM typically uses 5228, but it sometimes uses 5229 and 5230 that might be restricted by the firewall.

Upvotes: 1

Templar
Templar

Reputation: 5135

When you post a message to the Google GCM server (at https://android.googleapis.com/gcm/send), you need to pass three values: registration_id, collapse_key, and data.message. The collapse_key is likely your issue here.

Make sure that you pass a unique collapse_key for each message that needs to be reliably delivered. If you use the same collapse_key for each message, then GCM might drop multiple messages that are sent at around the same time.

You can find more information here: http://developer.android.com/google/gcm/adv.html.

Upvotes: 7

Parvin Gasimzade
Parvin Gasimzade

Reputation: 26032

Since you don't give much information about your situation and don't share code snippet it is hard to analyze the problem.But, as it is described in the documentation, GCM makes no guarantees about delivery or the order of messages.

Upvotes: 1

Related Questions