从Web角度看Notifications API和Push API之间的区别

时间:2022-11-24 13:26:28

What is the difference between Chrome Notifications API and the Push Notification API when developing Web notifications. When each one should be used and how are they different?

开发网络通知时,Chrome Notifications API和推送通知API之间有什么区别。什么时候应该使用它们,它们有何不同?

1 个解决方案

#1


14  

NOTIFICATION API The Notifications API lets a web page or app send notifications that are displayed outside the page at the system level; this lets web apps send information to a user even if the application is idle or in the background. This article looks at the basics of using this API in your own apps.

NOTIFICATION API Notifications API允许网页或应用程序发送在系统级别页面外显示的通知;这使得Web应用程序即使应用程序处于空闲状态或在后台也能向用户发送信息。本文将介绍在您自己的应用程序中使用此API的基础知识。

https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

PUSH API The Push API gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent. This lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. https://developer.mozilla.org/en/docs/Web/API/Push_API

PUSH API Push API使Web应用程序能够接收从服务器推送给它们的消息,无论Web应用程序是在前台,还是当前加载到用户代理上。这使开发人员可以向选择加入的用户提供异步通知和更新,从而更好地与及时的新内容互动。 https://developer.mozilla.org/en/docs/Web/API/Push_API

Check these links for more info: https://www.w3.org/TR/push-api/ https://www.w3.org/TR/notifications/

请访问以下链接以获取更多信息:https://www.w3.org/TR/push-api/ https://www.w3.org/TR/notifications/

#1


14  

NOTIFICATION API The Notifications API lets a web page or app send notifications that are displayed outside the page at the system level; this lets web apps send information to a user even if the application is idle or in the background. This article looks at the basics of using this API in your own apps.

NOTIFICATION API Notifications API允许网页或应用程序发送在系统级别页面外显示的通知;这使得Web应用程序即使应用程序处于空闲状态或在后台也能向用户发送信息。本文将介绍在您自己的应用程序中使用此API的基础知识。

https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

PUSH API The Push API gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent. This lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. https://developer.mozilla.org/en/docs/Web/API/Push_API

PUSH API Push API使Web应用程序能够接收从服务器推送给它们的消息,无论Web应用程序是在前台,还是当前加载到用户代理上。这使开发人员可以向选择加入的用户提供异步通知和更新,从而更好地与及时的新内容互动。 https://developer.mozilla.org/en/docs/Web/API/Push_API

Check these links for more info: https://www.w3.org/TR/push-api/ https://www.w3.org/TR/notifications/

请访问以下链接以获取更多信息:https://www.w3.org/TR/push-api/ https://www.w3.org/TR/notifications/