[This post was updated on March 30, 2018]
As we progress through 2018, those who read tech news will likely come across headlines about ‘progressive web apps’. According to Forbes, PWAs will replace most of the native apps we love, and they have the potential to be the ultimate cross platform app solution.
The Java programming language promised identical cross platform apps with its slogan “write once, run anywhere.” However, performance issues (especially in earlier versions) and security vulnerabilities have had some developers advocating for a better solution. The question is, can the PWAs succeed where Java failed?
What is a progressive web app?
PWAs can best be described as web apps with the potential to have “desktop-like” features and offline capability.
In 2015, web developer Alex Russel outlined the primary characteristics of PWAs which I’ve listed below.
- Responsive: to fit any form factor
- Connectivity independent: Progressively-enhanced with Service Workers to let them work offline
- App-like-interactions: Adopt a Shell + Content application model to create appy navigations & interactions
- Fresh: Transparently always up-to-date thanks to the Service Worker update process
- Safe: Served via TLS (a Service Worker requirement) to prevent snooping
- Discoverable: Are identifiable as “applications” thanks to W3C Manifests and Service Worker registration scope allowing search engines to find them
- Re-engageable: Can access the re-engagement UIs of the OS; e.g. Push Notifications
- Installable: to the home screen through browser-provided prompts, allowing users to “keep” apps they find most useful without the hassle of an app store
- Linkable: meaning they’re zero-friction, zero-install, and easy to share. The social power of URLs matters.
Why do progressive web apps matter?
There is currently a huge burden on developers to create apps for every platform. Currently, that’s four primary platforms - iOS, macOS, Android, and Windows. Web apps have been around for a while, but now we have the ability to create web apps that act like native apps and include richer functionality.
Apple’s App Store and Google’s Play Store have discoverability problems. Both companies have gone to great lengths to feature new and notable apps, but many don’t get featured or are buried - therefore invisible to users.
PWAs require a Web App Manifest - a JASON file that holds all the info about your PWA. This manifest allows PWAs to be indexed easier and ingested into the various app stores with little effort. In some respects, this is a solution to app discoverability issue as PWAs could be discovered through a store or serendipitously through the web. For instance, if tech-bytes.net was a PWA, you could add it as an app on your phone’s home screen through an app store or from a web browser.
Alex Russel provides good example of how PWAs can be installed on Android through the web.
Microsoft is all in on PWAs for this reason. According to tech journalist Paul Thurrott, Microsoft has tried every possible approach to incentivize developers to write high-quality apps for its Windows store, but to no avail. PWAs could solve this problem. They support Windows 10’s rich notification system and live tiles. In fact, Microsoft has indexed over one million PWAs by crawling the web, and soon they will be populating the store. Even more telling of Microsoft’s commitment, the company has said it will abandon any native features if PWAs meet or exceed the native functionality.
The PWA model makes sense for a variety of apps. Because average users don’t care what the underlying technology is, PWAs can simply be put in an app store environment and nobody will be the wiser.
Twitter Lite is a great example of a PWA that uses less resources and maintains much of the native app experience.
What are the challenges of PWAs?
For one thing, some apps will have to stay native (at least complex ones). Games and other apps that require direct access to the device hardware probably won’t see a web-alternative for some time.
Security is also a potential concern. While PWAs must use HTTPS to prevent potential security issues, my developer colleague and I discussed the issue and he asked the question “what’s to stop a PWA from using your phone to mine bitcoins?”. My colleague did some research, and according to a Google Developers post by Jake Archibald, PWA security well designed. Sync events - which happen when information is sent from a device to the server without explicitely asking permission from the user - are designed to prevent abuse. For instance, these sync events can only happen when the user has the PWA open in the browser window. Also, "The event execution time is capped, so you can’t use them to ping a server every x seconds, mine bitcoins." However, the author does state that "these restrictions may loosen/tighten based on real-world usage." PWA security, as it stands now, is solid. But, the issue might need to be revisited as these apps become more widespread.
While it’s not a fault of PWAs, the web browser as it is today might require some reimagining. Browsers aren’t a good multitasking solution because your apps are buried in tabs. Especially on mobile devices, users will expect to see PWAs in the multitasking screen. This is possible on Android, but iOS will also need to catch up.
Ultimately, the web browser will have to live a double life. For regular browsing, desktop and mobile versions of Chrome, Safari, and Firefox will continue in their current state. But, a PWA that’s opened from your home screen will need to appear as its own app. Once the browser is disassembled, the experience will be indistinguishable.
According to Andrew Gazedcki, writing for App Development Magazine, PWAs will solve the “app overload” problem that many users are feeling. This could be true, if PWAs aren’t present in any of the major app stores. All rumours suggest, however, that PWAs will be in an app store near you, so app discoverability issues on the major platforms will continue. PWAs only solve app overload for developers. In this respect, PWAs become the “install from the web” applications we always wanted on mobile.
What about other app technologies?
While the prospect of PWAs is very exciting, what about other solutions for making apps cross platform?
Since last year, Android apps can now be run on Chrome OS. However, the experience is less than ideal. Should Google scrap this project and just focus on getting developers to make PWAs that will automatically work everywhere? Maybe.
As Verge writer Dieter Bohn points out, it’s confusing to have two of the same apps on a device. Users probably won’t want to see a native and PWA version of Twitter or Spotify in an app store for instance.
Apple is rumoured to be doing something similar, by allowing developers to run iPad apps on macOS. Again, do PWAs make this ploy obsolete?
Microsoft has spent years developing the Universal Windows Platform (or UWP) - an application architecture that help developers write apps to run on Windows 10, Windows 10 Mobile, Xbox One, and Hololens. Why would a developer write an app in UWP if a PWA will work on all Microsoft, Google, and Apple platforms?
These other cross platform solutions are all good efforts, designed to reduce headaches for developers. The limitations of PWAs will determine if multiple cross platform solutions can co-exist.
So, what is a native app? If we define “native” as running code, or being written in a particular language, that allows for offline capability and access to device hardware, PWAs could be considered native if the technology progresses. As the technology driving PWAs evolves, we’ll stop referring to these languages and frameworks as “web technologies.” If the user can’t tell the difference, and the underlying technology is invisible, what does it matter?
PWAs are exciting and there’s clearly a lot of potential. Already there are native apps that use web technologies, so replacing some native apps with PWAs isn’t a huge stretch. While it’s unlikely to happen overnight, we might actually have a cross platform solution on the horizon.
Other PWA links
outwit.io (for finding PWAs through the web)