首页 > 解决方案 > 为什么在 Web 推送库上使用推送通知服务?

问题描述

我打算将推送通知添加到我的网络应用程序。

据我了解,要向我的用户推送通知,我可以使用Web 推送库并直接发送通知,或者使用推送通知服务,例如 OneSignal、Firebase Cloud Messaging 或 Batch.com。

据我了解,这些服务提供了一站式解决方案,不仅可以通过 Web 推送方式发送通知,还可以向 iOS 和 Android 应用程序发送通知。

如果我现在只关注 Web 推送,我应该知道直接在 Web 推送库上使用这些服务之一有什么优势吗?

标签: push-notificationweb-push

解决方案


Web Push is a standard which is still under development and subject to change. Also browser support is quite limited at the moment (see https://caniuse.com/#feat=push-api).

The advantage is: you have one API to rule all the supporting platforms (including desktop). Disadvantage is: You have to be aware that not all platforms support the standard.

Using a notification SaaS solution to handle notifications enables you to handle all platforms. Sending out a notification from your backend will be a single call to your notification SaaS service, but you still have to be aware, when you want to have native notifications on Android, iOS and the browser, you will have to handle the integration of those platforms differently in your client apps (see example here using Google Cloud Message integration in an Android App: https://firebase.google.com/docs/cloud-messaging/android/client).

So your decision should be based on which platforms you have to support. - If you get away with supporting Chrome, Firefox and Edge browsers on non-iOS-Devices (or handle iOS Notifications differently), you can use Web Push. - Otherwise i would choose a Notification SaaS Solution.


推荐阅读