not receive push for android - android

I am testing an apps. Push notification is working fine in our server environment. But in client's environment, large amount of Android devices (NOT ALL) do not receive any push notification.
What is the possible factor? the return status form GCM is "Failed"

the return status from GCM is "Failed"
Android Device which is Receiving push must be online, if not GCM will pool notifications till it reached a mark of 100, It will start clearing the pool if more notification arrives at their end
large amount of Android devices (NOT ALL) do not receive any push notification.
Did you check you have correct GCM ID with each device? If not The device will never receive a single notification. If your device have a valid GCM ID and have received some notification then it must be a problem in connecting with the device.
Also device must have Latest Play Services installed to get the notification on board

Related

How Android Oreo Knows that an FCM Message has arrived?

I know that FCM messages are sent to devices corresponding to FirebaseInstanceId.getInstance().getToken() and on onMessageReceived() the FCM messages are handled according to the need of the User. But if the app is not running and with all the background limitations in Oreo how the OS knows that a message has arrived?
how the OS knows that a message has arrived?
There is a socket connection between the phone and google's FCM server. This connection is shared between all apps on the phone that use FCM.
See here
When you ask FCM to deliver a message to your phone ABC and to the app with id XYZ, google's server will send some data to phone ABC. The FCM component on the phone then finds the app with id XYZ (it has to look up the correct app first because this connection might also receive data for other apps) and deliver the message to id.
This is managed by google so naturally the process doesn't suffer from background restrictions, assuming you set the right priority for your FCM message.

GCM Push notification not received on single device android

GCM Push notification is not received to one device alone. It is working fine with other mobile devices. GCM token is registered and it is active. But the notification is pushed but not received. The device model which is not receiving is Moto G4. To other users who uses this device model are receiving the notification. Please help in finding the issue. I tried re-installing the application and also cleared the cache. But no solution found.
First confirm once if there is no error message returned from GCM server. Check if the notification priority is 'high' in gcm/fcm send api
Try the code ##426## to check the hear beat status of your google play services.
Check if there are any device specific settings like 'Disabling autostart option'[in MIUI devices], 'no notification in locked state'[in oppo devices] or any security apps the kills your app if the app is in background.

Get list of devices for which GCM notifications delivery was failed

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.

GCM service does not work when offline[Android]

I am using GCM service to send some notifications in my android application.The notifications are pushed to other android device perfectly if that device is online(Use wi-fi or mobile data).But if that device is offline, then the GCM push notifications does not get to that device after it get online.Is there any code that I should add specifically to do this task or any other configurations to be configured?
In order for your message to be delivered on a device (that is currently offline) when it goes online. You can check the Time-To-Live parameter in your request. This parameter tells the GCM storage how long (in seconds) the message should be kept if the device is offline. It can be set up to a maximum 4 weeks which is also the default value if you don't specify one.

Push notification is works or not when there is no network in android device?

In my android application , i use push notification .I had one if there is no network connection in my android device means .Then push notification works or not in my android device
If the target device is not connected to the internet, then the GCM adds the Notifications to a pipeline to be delivered at a later stage. There are limitation on the pipeline size and the maximum time of un-connectivity, after which GCM aborts the pending GCM messages. But for a general case, this should do the needful.
You need Internet Connection.
GCM clients receive notifications through a socket, which is handled by Google Services to the Internet
Without Internet you will not receive any notification from GCM. Till your connection is not there GCM fill store all notification for you and as soon as you got connected it will release its burrer

Categories

Resources