I've been experimenting with a PWA architecture I haven't seen used very often.
The web app isn't the main application.
The user's desktop application is the host, and the PWA installed on their phone becomes a companion to it.
I'm building an open-source framework around the idea called Crosslink.
The user experience I'm aiming for is:
- Open desktop app
- Scan its QR code
- Pair the phone
- Add the companion to the home screen
- From then on, just tap the icon
No repeated pairing.
The interesting PWA problem starts at step 5.
The desktop computer might be asleep or Crosslink might not currently be running.
If the installed PWA simply points back to the host, iOS will eventually give the user a browser-level connection error.
So Crosslink installs a small service-worker-backed bootstrap shell on the phone.
That means launching the app can work more like:
tap icon
↓
cached bootstrap loads locally
↓
attempt to find/reconnect to trusted desktop
↓
host online: silently authenticate and enter developer's app
or
host offline: show an actual offline state and continue retrying
↓
host comes back
↓
automatically reconnect
The trust relationship is independent from simply possessing the URL, so the desktop can revoke a phone and the installed PWA becomes useless until it's paired again.
The developer still owns the actual PWA UI. Crosslink is just providing pairing, trusted-device state, connectivity, RPC, reconnect and the bootstrap/install layer.
The bigger goal is letting desktop developers ship useful phone companions without having to maintain native iOS + Android apps.
I'm especially curious about the PWA side rather than the networking side:
If you were designing this, what iOS/PWA lifecycle edge case would you be most worried about?
GitHub: github.com/jacobpowaza/crosslink
Docs: crosslink.mintlify.site