GCM notifications stop arriving after a few weeks

We have an Android app that we use to send content (technical articles, travel guides, etc.) to our users using GCM. We track the dispatch at two points using a REST call to some service:

  • Immediately after our servers send the notification.
  • Immediately after receiving our application.

What we are interested in is the ratio of the number of notifications received from those that were sent. We recently noticed that starting in March 2017, it looks like fewer notifications are reported as received and this ratio is decreasing. Obviously, our main problem is that notifications just don't reach Android devices.

A few notes:

  • We send a notification once every 7 days on average.
  • Apart from opening notifications and reading content, it is most likely that most of our users will not use or launch the app on a regular basis.
  • It looks like this drop started with the rollout of Android N and is getting more significant after the first two weeks after installing the app.
    If we compare Android M with N, then in the first two weeks, both OS versions have the same ratio for received notifications, but after that the ratio of Android N drops faster.

At first we thought that users "block all notifications" for our application (easier to do on Android N), but using NotificationManagerCompat.areNotificationsEnabled()

, we found out that this is not the case. We then tested our application behavior in Dose and Standby modes, but we could not find evidence that they were causing our problems.

Some technical information:

  • We are using GCM (not FCM). We use data notifications with a priority of normal , and we manually show the notification in the notification tray.
  • We use PushSharp to send notifications from our servers. If we receive that the "device subscription has expired" no longer sends a notification to this device.
  • In our Android app, weve updated the GCM token as recommended by Googles.
  • Ours GcmBroadcastReceiver

    is this WakefulBroadcastReceiver

    that uses startWakefulService

    to run GcmIntentService

    when a notification intent is received.
  • GcmIntentService

    handles the notification intent (and among other things, does the monitoring of the REST call I mentioned above) and made the calls once GcmBroadcastReceiver.completeWakefulIntent

    .

Not sharing the code as it is very straight forward, would be happy to share if needed.
I will be grateful for any ideas or ideas someone can share.

+3


source to share





All Articles