How to Kill Processes when App is in Background

Hi,

I have a wrapped app. Is there a way to pretty much have it enter a power saving mode when the user isn’t on the screen?

So like, I know there’s elements that will allow me to conditionally do things when users aren’t on the screen, however, idk how to conditionally tell bubble to KILL elements.

If I clear the data types of all elements, would that be useful? The thing about this though is that I only do a handful of “do a search for” frontend searches. Most of my data comes from Algolia, so it’s slightly different than if I was using a front-end search.

Your best bet (since it’s Bubble), is to make an “inactive” page, that has no resources, but then reverts back to the app when active again.

Other than that, can’t think of anything in particular other than stopping recurring workflows or … idk.

so by “page” do you mean “group” that functions as a page within our app shell?

Yep. And when that is visible, everything else isn’t. Keep in mind, the only way to really prevent resources from being used on a page is primarily based on the browser. Like edge, has the BrowserHealth functionality whereas it will stop unopened tabs from using resources.

the only other way would be deleting the items from your dom, then replacing it back on there when active… but don’t even get me started with that. That’s a lot of extra coding imo.

There may be more to this, but that’s what I know from my personal experience.

The scripts and libraries will always be loaded/running as long as they are on the dom, and visibility doesn’t have the ability to stop them.

gotcha, I’ll try it out