I have implemented chat in my project and using GCM for it.In this i have came across the strange issue.
I have do following steps for it.
Send chat message to server.
Server fetches reg key of device and send push message to GCM server.
Now on other device in which i am receiving push message i tried waiting for the push message for a long time.
But i did not receive the push message.
Now when i turn my wifi off and on it again or switch from 3g to wifi or vice-versa, i get all push messages at once.
I have read GCM docs and i also have seen these two questions in Stackoverflow.
Google Cloud Messaging - messages sometimes not received until network state changed
Device stops receiving GCM pushes until network is switched
I have also referred a google groups question regarding this issue
Problem in getting messages on device using GCM.
But i didn't get any solution till now.
I am using Asp.net at the server side.
Any help or suggestion is appreciated.
Related
I have a large scale project with hundreds of devices out in the field that I communicate with using GCM. Recently I've been experiencing a strange issue where many of these devices have stopped responding to my GCM messages. A couple things to note:
Sending my payload to Google's GCM servers still returns a proper 200 response.
The GCM keys for these devices have been verified to be correct/active.
The device will start receiving GCM messages if I move the device to a different network/subnet.
The device will start receiving GCM messages if I change its IP address on the same network.
The device will start receiving GCM messages with its initial IP address if I clear data of the Google Playservices package and restart my application.
It seems as if the socket for GCM has gotten stuck in a disconnected state and does not reconnect. These devices are typically connected via wifi which does sometimes drop, however... This past weekend, over 100 of these devices stopped responded so that leads me to believe some sort of TTL has expired and a refresh never happened.
Has anyone experienced anything like this before, or have any thoughts or suggestions about this?
I have implemented a server which will send some alerts to android devices. For most of devices, Notifications are getting received. However there are few devices to which notifications could not be delivered?
I would like to know if there is way to get list of such a devices for which notifications delivery was failed?
Does GCM provides this data(List of devices for which notifications delivery was failed)?
However there are few devices to which notifications could not be delivered.
If your devices don't receive notifications, try the following workarounds:
Make sure you've set your SENDER ID you've received from Google correctly.
Make sure your device was registered with Google's GCM service correctly.
Make sure you are sending the push to the correct reg id you've received from Google, and that you didn't receive an error from Google GCM service.
If you set the delay_while_idle = 1, the message won't reach the device if it's idle (off, offline, locked screen, etc...). Change it to delay_while_idle = 0 if you want your wakelock permission to make any difference.
Some times it takes time for the push to arrive, but if there is too much time, then there is a problem. Check what's the time_to_live of the push you've sent.
I would like to know if there is way to get list of such a devices for which notifications delivery was failed?
Based also from this thread, Google only provide some statistics that are available on the android developer console. This only shows the number of messages and registrations.
You would have to implement your own data collection, which could be done fairly easily. You could record the time & id of each message sent and have your android client report back to your server with the time of message receipt. You could then store the data on your server and query as needed.
You can check this View & diagnose Google Cloud Messaging (GCM) statistics link to know your GCM message status.
I'm new on sending push notifications on android. I try to send push notification for my testing application periodically. But sometimes device can't receive the notification. I searched about it and i think the problem is because of connection lost between server and my device. I think the solution is sending an heartbeat network packet on the push connection but i don't know how can i do it and to which server i should do it?
There is an application on google play store called as Push Notifications Fixer and i think this work is what i want to do
I'm currently working on an Android messaging app and GCM is utilized for notifications.
When the device of the recipient, that'd already be registered on GCM, is off, what exactly happens? Does GCM wait until the device is back online? If so, does the device send a message to say it's alive, or does GCM keep pinging the device? Or does GCM continually send the message until success? Either way, how long can the message persist on the GCM server when the device is offline?
Any direction would be helpful.
As per the documentation
Google enqueues and stores the message in case the device is offline.
When the device is online, Google sends the message to the device.
Detailed Explanation
If the device is not connected to GCM, the message will be stored until a connection is established.
how long can the message persist on the GCM server when the device is offline
If the device never gets connected again the message will eventually time out and be discarded from GCM storage. The default timeout is 4 weeks, unless the time_to_live flag is set.
I am trying to use GCM to try and send messages to my application even when the device is not connected to the internet. I know that GCM usually waits till the device has internet and then sends it the message. However, when I test it with my app by disabling WiFi, sending a push message and then enabling WiFi I do not see a message being received. I am following the exact example from this site. Since I am using an IntentService and BroadcastReceiver I figured it would handle the case. Do I have to make any other changes to make it work while the device has no internet? Since