BenMorel
BenMorel

Reputation: 36514

Why use a push notification service over a Web Push library?

I'm planning to add push notifications to my web app.

As far as I understand it, to push notifications to my users, I can either use a web push library and deliver the notifications directly, or use a push notification service such as OneSignal, Firebase Cloud Messaging, or Batch.com.

From what I understand, these services offer a one-stop solution to deliver notifications not only as Web Push, but also to iOS and Android apps.

If I'm focusing only on Web Push for now, is there any advantage I should be aware of, to use one of these services over a web push library directly?

Upvotes: 4

Views: 2258

Answers (5)

Ciprian Amariei
Ciprian Amariei

Reputation: 51

If you want to target iOS visitors also, this is not possible, as web push notifications are not supported by iOS.

To circumvent this, you need to use a third party service like Wise Notifications.

The alternative is to build an iOS app and send native push notifications.

Upvotes: 0

Markus S.
Markus S.

Reputation: 2812

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.

Upvotes: 6

Sagar
Sagar

Reputation: 4957

you can implement push notification to your website without using third-party libraries. You have required to get subscription token from the client and store this subscription token onto the server (Inside database). After when you want to send a push notification to the user then you have to just call endpoint (endpoint is mentioned in subscription token). That's it.

Due to security risk and managing subscription tokens, developers prefer to use firebase, AWS push notification or onesignal.com services. These services are optional you don't need at all.

Read links introduction to push notification and also the same lab code examples. Later I will update with simple working code for further reference to your question.

Upvotes: 3

guybrush
guybrush

Reputation: 394

It depends on what you want. It‘s not possible to use iOS Safari for Web-Push. For notifications to iOS you have to use a service or build your own app. I use Pushover for notifying myself from Scripts and Software. That may or may not be a solution depending on how much users you have, how many notifications you send and how willing your users are to use a web app like Pushover (or an app on iOS).

A service will keep notifications going when things change. So it should be less maintenance for you.

Upvotes: 1

t1gor
t1gor

Reputation: 1292

The most important point for me personally when doing your own implementation is that you control everything. This means that your notifications don't fail when AWS loses a region or pricing changes and you can't afford it any more. Not any provider can ban you because of the content you distribute or the complaints from users. You can implement your own logic for showing the notifications on the front-end, like stacking them or having your own segmentation rules (paying users versus free tier, for instance). I'm not even speaking of the custom subscription UI. No weird copyright in your messages.

From what I understand, these services offer a one-stop solution to deliver notifications not only as Web Push, but also to iOS and Android apps.

When you've got the server logic to process the app events and send notifications in place, it shouldn't be really hard to extent it do work with mobile push notifications. The only thing that changes is the way you subscribe devices.

And the last, but not the least - it's fun to develop. This is more of a personal matter, I guess, but I like learning new thing :)

Hope that helps you to make a decision.

Upvotes: 4

Related Questions