Edinburgh Web Development

Web apps catching up

New technology gives web apps native-like functionality

by Iain Wilson

14 October 2016

Recently we added a nice feature to one of our web apps.  In their Settings, users can register to receive push notifications each time one of the other members of their group adds some information.  

It works whether they are logged in to the app or not.  If their browser is open on any site, on desktop, tablet or phone, a notification message pops up to say there is information waiting for them.

On a desktop computer, a small notification window appears on the bottom right of the screen. On Android the notification is just like any app notification.  If they click on the message, it takes them to the web app.

A Web App breakthrough

Apart from being a pretty cool little feature, this represents something of a breakthrough for web apps. Not so much the feature itself, but the technology behind it.

It introduces functionality that means that a web application can operate even when it isn't loaded in the web browser.  And, in theory, when it isn't even connected to the Internet.

In broad terms, it gives web apps the capability to eventually work in a similar way to native Android and iPhone apps.

A single app version?

Imagine a situation where a single app could be written that would work on desktop, laptop, and Android/Apple tablets and phones!  

Well, of course you can have that already with a web app.  It will work on your browser on all of those devices, with one major proviso - you need to be connected ONLINE.

And that's a major drawback for web apps, and a major advantage for those native apps that can operate without an Internet connection.

Service Workers

So, enter Service Workers, the technology that could be a game changer for web apps.  

Introduced via a WC3 draft in 2015, it is perhaps a dumb name, but a Service worker is just a software program. Once registered, it sits there waiting for instructions, either from the web app or from network servers that send it instruction requests.

Push Notifications

In the notifications example, if someone is using the web app anywhere and they create some new information, the app sends a message to a notification service like Google Firebase. This then sends out the notification to the Service Worker on the other member's devices, and the Service Worker then shows the notification on the device.

Off-line apps

If a device is offline and the web app is started, the Service Worker dives into action.  Instead of displaying a 'No Internet Connection' error, the Service worker can display pages and images it has previously synchronised in the background, offering an app that can still provide functionality until it is back on-line.

Browser support

Like all things web, it takes a while for the newer technologies to be adopted by the browser companies.  Currently Chrome, Firefox and Opera support Service Workers and notifications.  Microsoft Edge is 'in development' and Safari 'under consideration', whatever that means.

The Future

So does this herald the end for native apps? Almost certainly not. There is just too much out there already.

Our guess is that there will always be a need for both, although if the technology works, some businesses may decide they can get what they need from a web app rather than needing two flavours of the same native app and all that entails.

A lot depends on the robustness of the technology and the take-up by developers.  If it gains sufficient traction in the next 12 months, we could see some amazing new web apps and the lines between web and native apps could start to seriously blur.

Liked this article? Please share it with your friends and colleagues.

comments powered by Disqus
Blot Design,
10 Colinton Road, Edinburgh, EH10 5DT
Terms, Cookies & Privacy