- Progressive Web Apps with React
- Scott Domes
- 199字
- 2021-07-08 09:36:12
Push notifications
There's no point in a chat application without notifications! Again, we're trying to emulate what has traditionally been a native app feature--push notifications directly to the user's device.
This problem is trickier than it might seem. Push notifications are only received when the app isn't open (that's the whole point, after all). So, if our web application isn't open and running, how can we possibly run the code to display a notification?
The answer is to use a third-party service that is engineered to send notifications to registered devices. So, rather than the device receiving the message alerting its user, the device sending the message alerts our notification service, which then notifies all relevant devices.
We also need a piece of code that is constantly "on"--always running and waiting to receive notifications from the third-party service and display them. This challenge only recently became solvable with web technology, and is one of the reasons PWAs are so exciting.
For now, don’t worry if this distinction doesn't "click" yet. We'll go into it in greater detail later. For now, the point is that push notifications will be an interesting challenge for our web application.
- Photoshop智能手機APP UI設計之道
- jQuery EasyUI網站開發實戰
- Apache Spark Graph Processing
- Java游戲服務器架構實戰
- Django:Web Development with Python
- The React Workshop
- Access 2016數據庫管
- Java Web程序設計任務教程
- Kivy Cookbook
- PHP編程基礎與實踐教程
- Hands-On Neural Network Programming with C#
- Learning Jakarta Struts 1.2: a concise and practical tutorial
- SCRATCH編程課:我的游戲我做主
- SaaS攻略:入門、實戰與進階
- 數據結構與算法詳解