Skip to content

What is a PWA: a browser app instead of an app store

B2Bnetwork team · · 6 min

Technology and trends

In brief

A PWA (progressive web app) is a web app the user installs from the browser onto the home screen of a phone or computer, without an app store. It relies on three elements: a manifest file with the name and icon, a service worker script that intercepts requests and enables offline work, and an HTTPS connection. It works well for forms, task lists and catalogs that must keep working on weak signal. It has limits: background work, NFC and data durability depend on the browser and the operating system.

What a PWA is made of

A PWA is an ordinary website with three additions. They make the browser treat it as an app: it can be installed, opens in its own window without the address bar and starts without a network.

ElementWhat it doesExample
web app manifesta JSON file with the name, icons, color and start URL"Service jobs", the company icon, opening on the task list
service workera script between the app and the network: caches files and data, handles notificationstoday's job list available in a basement with no signal
HTTPSan encrypted connection, required to register a service workerstandard for any business app

The manifest and service worker are defined by W3C specifications, so they do not depend on a single browser vendor. One app runs on Android, iPhone, Windows and macOS, and a new version is deployed on the server without store publishing.

Offline work: what to cache and how to sync

A service worker stores nothing on its own. The developer decides which files and data go into the cache and what happens without a network. Typical strategies:

StrategyHow it worksFor what
cache firstanswer from the cache, network only on a missapp files: code, styles, icons
network firsttry the network, fall back to the last saved versionjob list, stock levels
stale while revalidatethe old version at once, fetch the new one in the backgroundproduct catalog, price list
change queueuser actions saved locally and sent when the network returnsclosing a job, a photo, a signature

The change queue is the hardest part. A technician closes a job offline while a dispatcher changes it in the system. The conflict rule must be agreed upfront: who wins, what the user sees and what goes into the log. Working data is usually kept in IndexedDB, the database built into the browser.

Install and notifications on Android and iPhone

On Android, Chromium-based browsers can offer installation themselves when the site meets PWA criteria. On iPhone the user adds the app manually: the Share menu, then "Add to Home Screen". For an employee app, a short guide with screenshots or a message from IT is enough.

Notifications work on both systems, with a difference. Safari on iOS and iPadOS supports web push notifications from version 16.4 and only for apps added to the Home Screen. The permission request must follow a user action, such as tapping an "Enable notifications" button. A site open in the browser alone on an iPhone cannot send notifications.

Limits you need to know about

A PWA does not replace a mobile app in every process. Before deciding, check four things:

  1. Data durability. Browser data is "best effort" by default: the browser may delete it when space runs low. Safari with cross-site tracking prevention deletes script-created data if there has been no interaction with the site in the last seven days of browser use. The app can request persistent storage (`navigator.storage.persist()`), but the browser decides. A practical rule: send unsent changes to the server at the first opportunity and never keep the only copy of important data in the browser.
  2. Background work. A PWA cannot track location with the screen off or sync overnight as reliably as a native app.
  3. Peripherals. NFC, Bluetooth and attached readers work unevenly across browsers, and on iPhone some do not work at all.
  4. Store presence. If customers look for your brand in an app store, a PWA alone will not be there.

A comparison with web and mobile apps is in Web app vs mobile app.

When a PWA is a good choice

  • An app for employees on personal phones. No device management or store account needed: a link, install, sign in.
  • A field form on weak signal. A handover report, a fault report with a photo, an inspection checklist.
  • A catalog and ordering for sales reps. Price list and photos in the cache, the order sent when the network returns.
  • Fast start and frequent changes. A new version reaches everyone on refresh, with no wait for store review.

Load speed matters a lot here, because a PWA usually opens on a phone on a weak network. The metrics are covered in Core Web Vitals.

How to build a PWA: a step-by-step plan

  1. List the offline scenarios. What the user must do without a network and what can wait for signal.
  2. Add a manifest with the name, icons in the required sizes and the start URL.
  3. Write the service worker with a strategy for each resource type from the table above.
  4. Design the change queue and conflict rules, showing the user what has not been sent yet.
  5. Plan updates. A new service worker version takes control only once its lifecycle conditions are met, so a user may briefly keep working on the old one. Show a "New version available" message.
  6. Test on real phones: airplane mode halfway through a form, signal loss while uploading a photo, install on iPhone and Android, notifications with and without permission.

We build web apps, PWAs and mobile apps in our Application development service, usually as new modules for systems the company already runs.

Questions and answers

Does a PWA work on iPhone?

Yes. The app is added to the Home Screen from the Share menu in Safari. Since iOS 16.4 such an app can send web push notifications once the user agrees. Some features, such as NFC from the browser, do not work on iPhone, so check the list of features you need before deciding.

Can a PWA be published in an app store?

A PWA on its own does not go into a store, because it installs from the browser. There are ways to wrap it in a store app, but then review before publishing and separate releases come back. If store presence matters to your customers, consider a mobile app.

Is data in a PWA safe if the phone is lost?

Data stored in the browser sits on the device, so the same rules apply as for a mobile app: a screen lock, sign-out after inactivity, as little personal data in local storage as possible, and the ability to block the account from the server. Sensitive data is not kept offline longer than the process requires.

How much does it cost to turn a web app into a PWA?

A manifest and a basic service worker are a small piece of work. Cost grows with the scope of offline work: the change queue, conflicts, photo sync and device testing. That is why you start with a list of offline scenarios and estimate each one separately.

Considering a new technology for your system? Talk to an engineer.

Let's talk

Read more: Technology and trends

All in Technology and trends →