Skip to content

PWAs on Chrome and Android (WebAPK, TWA)

In one line: Chrome on Android is the most capable PWA platform — an installable PWA fires beforeinstallprompt, and when the user installs, Chrome silently mints a WebAPK so the app gets a real package on the launcher, its own icon, and OS-level integration. For app-store presence, the same web app can be wrapped in a Trusted Web Activity (TWA) and shipped to Google Play.

  • beforeinstallprompt. When your app meets the installability criteria (HTTPS, a valid manifest with name/icons/start_url, a service worker with a fetch handler), Chrome fires beforeinstallprompt. Call preventDefault() to stash the event, then trigger prompt() from your own install button at a moment that makes sense.
  • In-browser install UI. Chrome also surfaces an install entry point in the omnibox/menu, so users can install without your custom button.
  • appinstalled event. Fires once the install completes — a good hook to hide your install affordance and record the conversion.
let deferredPrompt = null;
window.addEventListener('beforeinstallprompt', (e) => {
e.preventDefault(); // suppress the mini-infobar
deferredPrompt = e; // save for your own button
showInstallButton();
});
installButton.addEventListener('click', async () => {
if (!deferredPrompt) return;
deferredPrompt.prompt();
await deferredPrompt.userChoice;
deferredPrompt = null; // can only be used once
});

When a user installs a qualifying PWA, Chrome requests a WebAPK from a Google-operated minting service and installs it on the device. This gives the PWA properties a bookmark shortcut never has:

  • First-class app identity. Its own entry in the app drawer, app-info screen, and long-press shortcuts; it shows up as an installed Android app.
  • Manifest-driven appearance. Name, icons (including maskable), theme color, display mode, and scope come from your manifest.
  • Intent handling. The WebAPK registers for your origin, so links into your scope can open in the installed app instead of a browser tab.
  • No Play Store needed. WebAPK installation happens entirely through Chrome — no developer account, signing, or store listing required.

A TWA runs your PWA full-screen, chromeless, inside an Android app you publish to Google Play. Unlike a WebView, a TWA renders in the user’s Chrome with full web-platform capabilities and shared storage.

  • Digital Asset Links verify ownership. You host an assetlinks.json that ties your app’s signing key to your origin; without it the TWA shows a URL bar.
  • Tooling. Bubblewrap (CLI) and PWABuilder generate the TWA wrapper project from your manifest and handle the Asset Links wiring.
  • Play billing. Distributing through Play means complying with Play policy; in-app digital goods generally require Play Billing.
Decision question Recommended action Rationale
Do I need the Play Store to install? No — WebAPK installs straight from Chrome. Only store distribution needs a TWA + Play listing.
When do I call prompt()? After saving beforeinstallprompt, from a user action. The event is one-shot and must be triggered by a gesture.
How do I get a Play listing? Wrap the PWA in a TWA with Bubblewrap/PWABuilder. A TWA reuses your web app and passes web capabilities through.
Why does my TWA show a URL bar? Fix Digital Asset Links (assetlinks.json). Ownership verification failed; the bar appears until it passes.
Icons look cropped on the launcher? Provide a maskable icon. Android applies a mask; non-maskable icons get clipped.
  • Meet installability criteria: HTTPS, valid manifest, service worker with a fetch handler.
  • Provide maskable icons so the WebAPK launcher icon renders correctly.
  • Handle beforeinstallprompt (stash + custom button) and appinstalled.
  • Set scope and start_url so the WebAPK captures the right links.
  • For Play distribution, generate a TWA with Bubblewrap or PWABuilder.
  • Host assetlinks.json and verify Digital Asset Links so no URL bar shows.
  • Use Play Billing for in-app digital goods to stay within Play policy.
  • Test install, launcher identity, and link capture on a real Android device.