Lesson 6 of 110 of 6 steps

Lesson 6 · about 20 minutes

Updates that actually arrive

Apps on a home screen hang on to old copies of themselves, so a change you put live might not show up on your phone. This lesson fixes that for good: a version number, a Check for updates button, and a friendly 'new version ready' bar.

Service worker versioning so installed apps pick up releases, a Check for updates button in Settings, and a restart bar when a new version lands in the background.

Installed apps keep their cached files until a new service worker arrives, so bump its version with every release. A Check for updates button in Settings fetches it, and a Restart bar appears when one lands in the background. iPhone pauses home-screen apps rather than closing them, so check for updates when the app comes back too.

How much have you built before?
This lesson's wording changes to match.
FreeEvery release reaches every phone
You're on version 13Check for updates
A new version is ready

What you'll make

  • A version number you can see in Settings
  • A Check for updates button that installs it
  • A 'new version ready · Restart' bar

You'll need: an app installed on your home screen (lesson 2).

1

Why phones keep old versions

An installed web app keeps a copy of its files on the phone so it opens instantly, even with no signal. That's good, until you change something: the phone keeps showing its saved copy. It's like a map you downloaded for a trip: handy offline, but it won't show a new road until you download it again.

That copy lives in the service worker's cache. Without a new service worker, there's no install, no activate, no new cache.

2

A version number on every release

Say to your agent
Give the app a version number that goes up with every release, so phones know there's something new. Show it in Settings.

From now on, your agent bumps it each time it puts the app live. With the skill installed, that's part of its release checklist.

3

Check for updates in Settings

Say to your agent
Add 'Check for updates' to Settings. If there's a new version, install it and restart; if not, say I'm up to date and show the version.
You're on version 12
A new version is ready
You should see

Tap "Release a new version" to see what happens on a phone.

4

A restart bar when one arrives

When a new version downloads while you're using the app, it shouldn't restart under your thumb in the middle of typing. Instead, a small bar offers a restart when you're ready.

Say to your agent
When a new version arrives in the background, show a bar saying a new version is ready, with a Restart button. Don't restart on its own.

iPhone keeps home-screen apps paused rather than closing them, so the app should also check when it's reopened.

5

The first time, the old way

The version on your phone right now doesn't have the button yet. Close the app fully (swipe it away), open it again, maybe twice, until Settings shows "Check for updates". From then on it looks after itself.

Tell your users: the same thing, once, after the release that adds this.

6

When two phones are on different versions

For a few minutes after a release, one phone may be new and another old. Small changes are fine. A brand-new feature might confuse the old version, so update both phones first.

My partner's phone shows something odd after a release
Ask them to open Settings → Check for updates. If it still looks wrong, ask your agent: old and new versions should always be able to share the same data.

Did it work?

Tick these off. They're saved in this browser, so you can come back later.

  • Settings shows my app's version
  • Check for updates finds and installs a new version
  • A 'new version ready' bar appears on its own
  • Both phones were on the new version before I used a new feature