Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
192 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...