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:
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:
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:
GcmBroadcastReceiver
is a WakefulBroadcastReceiver
that uses startWakefulService
to start a GcmIntentService
when receiving a notification intent.GcmIntentService
handles the notification intent (and among other stuff makes the monitoring REST call I mentioned above) and once done calls GcmBroadcastReceiver.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.
--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/97158276-8555-444b-9e7a-cc81ec41be65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi DiegoThanks for the prompt reply!Regarding the collection of message IDs, we actually tried using FCM diagnostics on the Google Play console to track some messages but the thing is that it's hard for us looking at a few random messages and from whatever we discover to assume statistically that this is indeed our issue for the rest of the users. Take for example the Galaxy Note 7 that Samsung shutdown using an OTA update - these devices simply "disappeared" so checking one of these won't help us understand our issue. Am I making sense?
We couldn't find it, but perhaps there's an API we can use to query each message for its GCM status and by that reach a more accurate result?
As for the other suggestions:1) We only send "data" notifications and use its default "normal" priority. We haven't try sending "high" ones yet (actually we're "afraid" of Google's ML and being flagged in some way).
2) We use the default TTL (4 weeks if I'm not mistaken) and we're actually using android-priority-jobqueue to persist the "notification received" event until the network request succeed.3) We experience this drop in the majority of vendors and models... nothing specific.And thanks for the heads up for Android O and the JobScheduler. We actually just finished replacing our WakefulBroadcastReceiver implementation with the described here, hoping it'll help us with the issue.
But another question - our app references 'com.google.android.gms:play-services-gcm:9.6.1'. Any chance upgrading to 11.0.2 can help with what we're seeing?I did see Android O requires version 10 and above so I'll guess we'll have to upgrade no matter what.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/16c4b4ba-2713-437d-968d-82a22261229f%40googlegroups.com.