Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progressive web app #243

Open
deansallinen opened this issue Nov 19, 2024 · 2 comments
Open

Progressive web app #243

deansallinen opened this issue Nov 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@deansallinen
Copy link
Contributor

deansallinen commented Nov 19, 2024

Using the Vite PWA plugin for SvelteKit, we can create a service worker and manifest.

We can then start using the service worker to run data synchronization in the background, off the main thread, to fetch updated network and account data on a regular interval, for example. Or to fetch account activity pre-emptively when landing on the account overview page.

We can also enable installing as an application, which will cache pre-rendered pages to the user's device and enable "offline" mode.

A service worker would also open up the Push API if we wanted to send notifications to the user (e.g. on new activity)

@deansallinen deansallinen added the enhancement New feature or request label Nov 19, 2024
@sandroguras
Copy link
Contributor

I looked into this PWA plugin, v0.1.0, which is currently in a very early stage. Its main benefit is that you can tweak the PWA setup from a single source. Without the plugin, it's straightforward to create a service worker, manifest, and set of icons, so I'm not sure we need another dependency for this task.

@aaroncox
Copy link
Member

I know we talked about a couple of the challenges with this on slack already, but figured I'd just repeat some of them here as well.

Anchor on mobile is really the only wallet this would be compatible with as well, since most of the other mobile wallets use in-app/wallet browsers. A PWA installed Unicove wouldn't open in those other wallets and they'd always just be in the browser version.

Routing between Unicove and Anchor is also going to be difficult.

The reason is because we'd need to do something with the callback URLs from the ESR payloads that lets Anchor, once it completes a request from the Unicove PWA, to then route back to the PWA. The only way on iOS this is possible (I think) is by using a custom URI (like we have for anchorwallet:// or something) to launch another app, or by default we just swap back to whatever the users primary browser is.

I'd bet PWAs don't support registering URI handlers in the OS, so how would Anchor route back to the PWA?

You mentioned Push APIs, but I'm not sure if PWAs could listen in the background with them. If that's possible then maybe there's a way Anchor could somehow trigger a push call somewhere that just triggered the Unicove PWA again. Then it's how do we modify the mobile versions of Anchor to send out this push call? Does it use buoy, and we have some sort of translation layer that takes in that response, converts it to a push call, that notifies Uncove PWA to just open back up?

Ugh 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants