TL;DR: iOS' Web Push implementation kind of defeats a key point of the web.
Yesterday, the WebKit team dropped some big news:
iOS and iPad OS 16.4 beta 1 won't just bring support for Web Push, they will also add support for the Badging API and 3rd-party browsers will finally be allowed to add a website to the home screen! That's a lot of good stuff that will make the web able to better compete with native!
Update: Feb 19, 2023
In case you have no idea why the entire web dev community had their mind blown by this, John Allsopp wrote a great summary titled A very significant day for the Web.
Sure, there's plenty to moan about, like how the WebKit blog explains what Web Push is as if it's a brand new feature. As if Web Push hasn't been available on every major browser (except Safari) and every operating system (except iOS) for the last ~7 years.
But before I get into some of that moaning, let's take a moment to celebrate.
Yesterday was a good day.
Right. With that out of the way, let's dive into one of the caveats regarding the upcoming Web Push implementation on iOS that immediately jumped out at me:
One does not simply request permission
A web app that has been added to the Home Screen can request permission to receive push notifications [...]
WebKit Blog: Web Push for Web Apps on iOS and iPadOS
And Firtman confirms:
Web Push on iOS and iPadOS 16.4 beta 1
🚫Not available in Safari
🚫Not available in third-party browsers
🚫Not available in Web Views
✅Available on PWAs installed in the home screen using the A2HS action from:
a) Safari's classic share menu
b) Third-party browsers' share mentwitter.com/firt/status/1626332953633603586tQ91
In other words: users have to install the web app before it can request for the permission to send push notifications.
On the one hand, the restriction kind of makes sense. It ensures that websites can't spam the user with notification permission requests - and boy do we know that sites just love to do that. I can't count the times I was searching for some information, clicked a link and before I had a chance to see if the page actually contained any useful information, it was asking me if I was interested in getting push notifications.
The web just can't seem to have nice things because
some almost every single website on earth will immediately find a way to make it the most annoying thing ever. And I'm not saying it's the product owner, marketing and/or sales team, but I bet they aren't helping either.
So, yeah, I get it. We can't have every website pop up the permission dialog on page load. But I also think that restricting Web Push to installed web apps is kind of defeating the point of Web Push being a web feature.
Quiet notification prompts
As it turns out, pretty much every other browser (you know, the ones that have supported Web Push for the last 7-ish years) already made an attempt to solve this problem, and their solution doesn't require the user to install the web app.
Chrome, Edge and Firefox have all tweaked when and how notification permission prompts are shown.
It basically boils down to this: if a site attempts to show a notification prompt, the browser checks if the user has actually engaged with the site. If the request is made from a user interaction or the user has engaged with the site for an X amount of time, the usual pop-up is shown. But if the site tries to prompt the user on page load, without user interaction, a fairly subtle icon shows up somewhere in the address bar.
Instead of doing what the competing browsers are doing (and learning from years of experience of handling Web Push), Apple decided to reinvent a wheel here. What they've turned up with looks a lot more like a square.
What makes this even harder to swallow is that they do not impose the installation requirement on websites in Safari for macOS. For some inexplicable reason, they've decided that, on iOS, they needed to add an extra hurdle for the user to grant a website permission to send notifications.
Just like native apps
The Verge summed it up nicely (highlight added):
Here’s how the push notifications will work, according to the blog post by Brady Eidson and Jen Simmons — though it sounds a lot like how they work with native apps already:
Jay Peters, The Verge: iOS 16.4 will let web apps on your homescreen send push notifications
Which made me think:
What's the point of the web if it works just like native apps?
The web's biggest super power is that you do not have to install an app. You can just scan a barcode, click a link, search for something or even type an address and BOOM! you're there! There is no need to install anything!
There are many use-cases for push notifications from websites you only visit every so often. For example, the Google I/O website lets you browse the various talks and subscribe for notifications for specific events you don't want to miss. You could add the site to your home screen, but on the other hand: why would you? You only need the site a couple of weeks a year.
Another example is something Luke Wroblewski talked about during one of his talks 1: bike sharing apps. He argued that these apps should probably just be websites. Why would you insist on people installing your app if they only need to rent a bike every so often, for example when they visit a city and need a bike to get around and see all the sights? Let them scan a barcode, go to a website, create an account (if they don't have one yet) and rent the bike. When they're done, they park the bike and end the rental via the same site. No install required!
But it would be really nice if that site could send you a reminder that the meter is running and offer an easy way to get back to the site, right? With Apple's implementation, you need to install the site as a web app before they can send you that reminder.
Like native, but with super powers
Circling back on what I wrote earlier:
What's the point of the web if it works just like native apps?
The web has, of course, many uses besides not needing to install anything. And while I may have used that phrasing to sound a bit more dramatic, what I'm really trying to say is that I'd like the web to have more native-like features, but without making it the same as a native app.
Make web apps more powerful, but don't take away the web's super powers in the process.
- Bruno Stasse for proof-reading and feedback 💖
1 I really need to look up that video of the talk where Lukew is arguing that bike sharing apps should just be websites.