0

I'm using firebase for push notifications on both my android and iOS app with everything working fine. If I reboot the device, the push notifications do come though, but after a period of time (around 1 - 2 minutes). WhatsApp on the other hand manages to fire push notifications almost immediately. I'm wondering how I can obtain this kind of performance. I've read that on android I could start a background service on boot up, but what good would that do?

Android push notifications after device reboot

The only thing I can think to do in a background service from boot up is to subscribe to push notifications again, but I doubt this would speed up the process of getting them?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
David Andrew Thorpe
  • 838
  • 1
  • 9
  • 23

1 Answers1

1

It will need Message Queue to deal with that. But it will need server to do the most of things.

Because of WhatsApp is a chat app, it will produce large number of messages all the time.

Therefore, we can use Message Queue to store messages temporarily between client and server to solve when the network is wrong or device is off line(the same as Phone off).

As soon as the device is online, the Message Queue will send message to the mobile device.

You could have a look at RabbitMQ, it is the most widely deployed open source message broker. And there are many good discussions about using it in Google, you could search to check.

Junior Jiang
  • 12,430
  • 1
  • 10
  • 30