We have an Android app we use to send content (tech articles, walk-through guides, etc.) to our users using GCM. We're monitoring the sending at two points using a REST call to some service:
- Immediately after our servers send a notification.
- Immediately once our app receives it.
What interests us is the ratio of how many notifications reached the app out of those that were sent. Recently we noticed that starting March 2017 it looks like less notifications are reported as received and this ratio dropped. Obviously our primary concern is that notifications are simply not reaching the Android devices.
A few notes:
- We send a notification once every 7 days on average.
- Other than opening the notifications and reading the content that, it is most likely that the majority of our users won't use or launch the app on a regular basis.
- It looks like this drop started with the rolling out of Android N and is becoming more significant after the first two weeks since the app was first installed.
Meaning comparing Android M to N, at the first two weeks both OS versions have the same ratio for received notifications but after that Android N's ratio drops more quickly.
At first we thought users are "blocking all notifications" for our app (easier to do on Android N) but using NotificationManagerCompat.areNotificationsEnabled()
we found out this is not the case.
We then tested our app behavior under Doze and Standby modes but we couldn't find evidence that they are the cause for our issues.
Some technical info:
- We use GCM (not FCM). We use data type notifications with normal priority, and we're displaying the notification in the notifications tray manually.
- We use PushSharp to send the notifications from our servers. If we get a “Device subscription has expired” we’ll no longer send notifications to that device.
- On our Android app we’ve implemented the GCM token refresh according to Google’s guidelines.
- Our
GcmBroadcastReceiver
is aWakefulBroadcastReceiver
that usesstartWakefulService
to start aGcmIntentService
when receiving a notification intent. - The
GcmIntentService
handles the notification intent (and among other stuff makes the monitoring REST call I mentioned above) and once done callsGcmBroadcastReceiver.completeWakefulIntent
.
Not sharing code as it's very straight forward, will be happy to share if relevant.
I'll appreciate any insights or ideas someone can share.