Allow user to completely reset app to originally installed state

Is there a way to allow a user to completely reset an application?

The goal: to have a button to reset in such a way that it’s like the app was just installed.

try

 window.location.reload()

That’s a reload, not a reset. A reset will destroy cookies, kill localsession, remove databases, etc. It will revert back to the original state of install (just like factory reset will on your device).

Ok i understand :wink:

my suggestion … create function with promise to reset all you need (cookies, localstorage, …) and on all end, reload app

clear cookies

window.cookies.clear(function() {
   console.log('Cookies cleared!');
});

clear localstorage

window.localStorage.clear();

These are things I already do.

These have nothing to do with a factory reset. I’m not asking how to clear cookies. I do this already. I want a full reset that will reset even the stuff you miss I’d expect this to exist given how self-contained Ionic can be on a device. It should be an inherent sandbox feature. Alas, it seems not to exist.

Even then, cookies.clear is PhoneGap plugin.