The Native Web is finally here

People typically believe that native offers lots of benefits over the web – fast, responsive, accessible, animated. Sound familiar? For a long time this was actually true. But not so much now.

By Jason Petersen, Senior Developer at Digital Detox In Journal, Dev

Progressive Web Apps, or PWAs, have become the talk of the tech industry as a ‘native killer’, especially over the last couple of months. A bold claim – or at least that’s what I first thought. If you’re thinking the same then keep reading as we’ll unpack the innovations pioneering the evolution of what some are calling “the native web”.

Looking into PWAs, I found them to be web apps that use a specific set of technologies, some old some new, to deliver a user experience comparable to native. The definition seems simple enough. But exactly what does it mean for the web to be more like native?

Add to homescreen

Native apps have always been preferred over the web because of two key benefits, namely user re-engagement and user experience – though perhaps the latter to a lesser extent.

It only takes a touch of that icon on the homescreen to launch your app. But for the web there’s always been bit of dodging, ducking, dipping and diving to load that web page as you navigate through your ‘native’ browser, your tabs, the search bar and it goes on (yes, this might sound just like dodgeball as you may instead get hit with an offline page, but that’s a chat for later).

But this is no longer the case. With a simple addition of a new configuration file you can now add web pages direct to your homescreen, making them just as quick to re-engage users as native. One small caveat though – users still have to visit the site in the first place. But you could argue just as readily that users still have to go to the app store to download a native app. Case closed.

Talking to your users

Commercial businesses need direct access to consumers to survive and thrive for everything from user acquisition and initial engagement to all future interactions. These businesses use native apps to send push notifications to communicate personalised or generic alerts, promotions, reminders, and updates with almost immediate effect.

When users interact with push notifications on their device, whether from the lock screen or notification centre, they’re taken straight to the app and the content the business wants them to see. The web has been missing this tech for a long time and without native apps to help, businesses have had to resort to lesser communications like online marketing, emails and tedious phone calls. People are all too familiar with these tactics and so they’re often ignored with hundreds, if not thousands or millions of pounds wasted. That was the case, at least, until Google, Samsung and Mozilla and a few others spearheaded efforts to bring this tech to the web – by introducing service workers.

Service workers are special in that they can run in the background irrespective of whether the browser is open or closed. This ability to run behind the scenes make it possible to stay connected to a push service that allow businesses to send notifications straight to a user’s device at any time either manually or automatically, much like they can with native – with their permission ofcourse.

Offline first

Native has most of the files it needs to run the app when the user first installs it on their device – except where more information is needed from the network. Web resources, however, have to be downloaded when the user visits the web page. Even then the user must still be online if they refresh the page, or perform an action that requires further communication with the network. There’s nothing worse than clicking a ‘Continue’ prompt only for the website to reload with the painful sight of the browser’s default offline page, ruthlessly coercing you to stop whatever it is you were doing, to abandon the cause, to realise it was all a waste of time. Better luck next time – if you stay connected to the internet long enough.

For some native apps the transition from online to offline can be seamless and users can often complete their task unhindered. Unlike a browser you don’t have a default ‘no internet connection’ page, which forces native designers and developers to present a user-friendly alternative – a courtesy that has never been possible for web users until now. Service workers also possess other remarkable talents, like the capability to control network responses. It’s with this concept that first steps can be taken to take control of the user’s offline experience and deliver something they can benefit from – this is ‘offline first’.

During installation service workers would typically cache the resources they need for the page in question to perform as intended. This ensures those same assets can be used when the user returns to the site, whether they’re online or offline – potentially saving the user the time it would take them to download it again and the data it would cost them to do so.

Final thoughts

As you might have imagined service workers are not the only shiny new piece of tech at play here. If you’re a developer there are a few concepts and functionalities to wrap your head around before getting hands on with your first PWA.

You’re better off following Google’s Progressive Web Apps Training online if you’re especially new to this space. And next time someone says native is better than the web, go forth and set the record straight with the full force of your new found knowledge – or even better, point them to read this article. Spread the word that the time of the native web is upon on us.

Further reading

Take a look at Service Worker – first draft published by Jake Archibald back in May 2014.

Other blogs