Android: Delay in Receiving message in FCM(onMessageReceived)

karsas

In Test app, I have implemented FCM for sending notification messages using

https://github.com/firebase/quickstart-android/tree/master/messaging

For testing I sent the message(8:42 PM) from firebase console using the "New Message" under Notification.

Sent at 8:42 PM

But in my emulator, I have received the message at 9:06 PM

received at 9:06 PM

Please let me know if there is anything to do reduce the delay.

Thank you.

Elad Nava

This could be caused by the unrealistic heartbeat intervals in Firebase Cloud Messaging.

FCM works by maintaining an idle socket connection from an Android device to Google’s servers. This is great because it barely consumes battery power (contrary to polling), and it allows the device to be woken up instantly when a message arrives.

To make sure that the connection remains active, Android will send a heartbeat every 28 minutes on mobile connection and every 15 minutes on WiFi. If the heartbeat failed, the connection has been terminated, and FCM will re-establish it and attempt to retrieve any pending push notifications. The higher the heartbeat interval, the less battery consumed and the less times the device has to be woken up from sleep.

However, this comes at a great price: the longer the heartbeat interval, the longer it takes to identify a broken socket connection. Google has not tested these intervals in real-life situations thoroughly enough before deploying FCM. The problem with these intervals is caused by network routers and mobile carriers, who disconnect idle socket connections after a few minutes of inactivity.

More info is available on my blog:

http://eladnava.com/google-cloud-messaging-extremely-unreliable/

As a workaround, please consider Pushy (https://pushy.me), a drop-in replacement for GCM/FCM which greatly improves notification speed & reliability (Full disclosure - I founded Pushy).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Delay receiving a message on an Azure ServiceBus Topic

From Dev

Handler on android not receiving the message

From Dev

Android EventBus - Sequence for receiving message

From Dev

Not receiving Cloud function FCM message in android 8

From Dev

Android stop notification in status bar while receiving message

From Dev

When receiving the sms, only the message was displayed but app didnt open - Android

From Dev

Android Wear - receiving message from Wear without WearableListenerService?

From Dev

Why the delay when receiving data?

From Dev

Child process not receiving message

From Dev

The "this" pointer and message receiving in D

From Dev

Receiving message in a transaction

From Dev

Erlang message receiving order

From Dev

Server not receiving message properly?

From Dev

Elixir process not receiving message

From Dev

"Please wait" message with delay

From Dev

Huge delay between sending and receiving an intent

From Dev

Huge delay between sending and receiving an intent

From Dev

gcm not receiving message on client side

From Dev

ActiveMQ different ways for receiving message

From Dev

Threaded SocketServer not receiving second message

From Dev

Receiving "role" and/or "affiliation" with message in SleekXMPP

From Dev

Synchronizing message sending and receiving AGSXMPP

From Dev

Receiving "role" and/or "affiliation" with message in SleekXMPP

From Dev

How to prevent receiving broadcast message

From Dev

When trying to build, receiving this error message "error: resource android:attr/fontVariationSettings not found."

From Dev

Hover transitional delay with sequential message

From Dev

JQuery message should delay() and fadeOut()

From Dev

Alertify - Show success message with delay

From Dev

Adding delay on jms message processing

Related Related

  1. 1

    Delay receiving a message on an Azure ServiceBus Topic

  2. 2

    Handler on android not receiving the message

  3. 3

    Android EventBus - Sequence for receiving message

  4. 4

    Not receiving Cloud function FCM message in android 8

  5. 5

    Android stop notification in status bar while receiving message

  6. 6

    When receiving the sms, only the message was displayed but app didnt open - Android

  7. 7

    Android Wear - receiving message from Wear without WearableListenerService?

  8. 8

    Why the delay when receiving data?

  9. 9

    Child process not receiving message

  10. 10

    The "this" pointer and message receiving in D

  11. 11

    Receiving message in a transaction

  12. 12

    Erlang message receiving order

  13. 13

    Server not receiving message properly?

  14. 14

    Elixir process not receiving message

  15. 15

    "Please wait" message with delay

  16. 16

    Huge delay between sending and receiving an intent

  17. 17

    Huge delay between sending and receiving an intent

  18. 18

    gcm not receiving message on client side

  19. 19

    ActiveMQ different ways for receiving message

  20. 20

    Threaded SocketServer not receiving second message

  21. 21

    Receiving "role" and/or "affiliation" with message in SleekXMPP

  22. 22

    Synchronizing message sending and receiving AGSXMPP

  23. 23

    Receiving "role" and/or "affiliation" with message in SleekXMPP

  24. 24

    How to prevent receiving broadcast message

  25. 25

    When trying to build, receiving this error message "error: resource android:attr/fontVariationSettings not found."

  26. 26

    Hover transitional delay with sequential message

  27. 27

    JQuery message should delay() and fadeOut()

  28. 28

    Alertify - Show success message with delay

  29. 29

    Adding delay on jms message processing

HotTag

Archive