Ionic remove storage after close app in background

i use localstorage to store data
how can remove storage after close app in background
or use not used app in 30 minut

I’m not sure if I understand what you’re asking, but sort of by definition it’s not possible for your app to do anything while it’s not running. There are various plugins that I see promoted from time to time that purport to keep Ionic apps running when the user is not directly interacting with them, but I’m not going to promote or advise anything concerning them because I feel that users should be completely in charge of what uses their resources (most notably battery life) on their devices, and anything that attempts to circumvent that will eventually boomerang on the app’s reputation, if not that of Ionic itself.