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

user initiated 'uninstall' event #998

Open
davidmaxwaterman opened this issue Oct 26, 2016 · 3 comments
Open

user initiated 'uninstall' event #998

davidmaxwaterman opened this issue Oct 26, 2016 · 3 comments

Comments

@davidmaxwaterman
Copy link

I'm looking for clarification of how a user might 'uninstall' a Progressive Web App that has been installed on their home screen.

Use case :

  1. A user has added a PWA to their home screen.
  2. They want to regain storage space for some photos or whatever they want to take.
  3. They decide they can do without this PWA and it's associated storage.
  4. They're used to being able to uninstall apps so they try to 'uninstall' the PWA.

At this point, iinm, all they have is 'remove' to remove the icon from the homescreen. I imagine the user might assume this would also remove the service worker and the associated caches, but I think this is not the case, and so there is little benefit to the user (short of making space on the home screen).

IINM, the only method of removing a service worker is via the chrome://serviceworker-internals page which is clearly not end-user friendly.

It strikes me that it might be possible for the 'remove' action to cause an 'uninstall' event to be fired in the corresponding service worker, and then it is up to the service worker to remove the caches and/or unregister itself, presumably causing it to be removed completely from chrome (akin to the chrome://serviceworker-internals 'unregister' button). This leaves the possibility for the sw to not uninstall itself/etc, which might possibly be desirable - or at least prompt the user before doing so (via the app) - and also sending a message to a server to record that the user has decided to uninstall (useful for the app's authors to know).
On the other hand, all that sounds like it is riddled with problems (not least privacy), so perhaps it should be possible for the user to do a 'hard uninstall' where the service worker and caches are just removed without any events/etc....or a combination.

Is this 'death' part of the PWA life cycle being discussed anywhere? ..or is it all here, which I've yet to dig through.

@marcoscaceres
Copy link
Member

Some related lifecycle events stuff is here too:
w3c/manifest#417

The "appinstall" event was at least defined as part of Web Manifest, but doesn't interact with a service worker.

Also related (manifest + SW integration):
w3c/manifest#161

Which would associate a PWA with a service worker. That would be the right place to maybe receive any such "uninstall" event.

Having said that, last I heard, there was no way for Android today to notify the browser when a PWA's icon is removed from the home screen. I heard rumors that such an OS-level event is coming to a future version of Android, but maybe someone from Google can confirm?

@marcoscaceres
Copy link
Member

For reference, "installable web applications".

@g-div
Copy link

g-div commented Sep 21, 2017

Chrome now introduced WebAPKs for Android:
"They attempt to providing additional glue to give Progress Web Apps deeper integration into the Android OS, similar to native apps."

But as far as I understand, they don't provide an uninstall event, and therefore don't solve the discussed problem.

This is extremely problematic since an user will continue to receive pushes notifications also after uninstalling the WebAPK. An uninstall event would allow to unregister the installed ServiceWorker.

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

No branches or pull requests

3 participants