Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
243 views
in Technique[技术] by (71.8m points)

c# - Get push notifications quicker after device reboot

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...