Messaging delays when reactivating data connection on Android

133 views
Skip to first unread message

Massimo Di Cosimo

unread,
Oct 13, 2016, 2:57:33 AM10/13/16
to Firebase Google Group
Hello there,
I'm testing FCM and I need an explanation.
I have a Samsung S5 with Android 6 and when I go to sleep I leave the phone on but I turn off 3g Data Connection. Since I don't have WiFi, this means no data traffic in the night.
When in the morning I reactivate data connection, messages for my test app arrive only after a lot of minutes (30 / 40).
On the contrary, Gmail alerts are immediately shown.
For messages to my app I choose the following options:
- message type: data
- message to topics
- high priority
- collapsible messages

During the day, FCM messages arrive always immediately, even if phone is with screen off.

I noted that when my notifications arrive after night, also other apps, such as Yahoo Mail, show their notifications.
This somehow reminds me the "Doze" mechanism in Android, but
- why Gmail passes through? (notifications are shown just some instants after reactivating Data Connection)
- shouldn't the "High priority" setting allow my notifications to be sent as soon as possible?

Thanks for any help or explanation.
Max

Kato Richardson

unread,
Oct 13, 2016, 1:09:33 PM10/13/16
to Firebase Google Group
Hi Max,

I think that the primary thing to keep in mind here is that loading gmail data is a pull operation (similar to what would happen with Firebase Database if you went offline and came back). However, FCM messages are a push operation (the server notifies the client of changes; the client doesn't say, "Hey, got any data for me?"). 

It's probably way out of band for FCM to try and deliver messages to every offline client on a smallish interval such as seconds. Thus, it probably uses a back-off retry or something similar. If you've been offline all night, I'd expect some delay before they arrive. Note that this is similar to how some SMS carries work as well. If my phone is off for a night, it can be several hours before all my SMS messages sync.

That said, there may be room for improvement here. Perhaps our brilliant FCM experts could find a way for the client to let us know when it's back and grab anything outstanding? I'll send this over to them for discussion and see if there's a feature request here.

☼, Kato




--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/436167d4-d7c7-46af-aead-f0557903607c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages