What happens after app is closed #6331
Replies: 1 comment
-
Posted at 2023-10-23 by rigrigrig
Posted at 2023-10-24 by charlie Thanks for the response. What situation would you want to turn on the gps and have something else turn it off? This is why I wondered if app id was legacy and was always being injected anyway. It means a widget could turn the gps off for my app without me knowing (not sure why they would...but they could). I also feel like widgets should be restricted to showing information and not changing any. If a boot app is managing power and says "no sorry you can't have gps on at moment" it can't switch it off until my app exits? Posted at 2023-10-24 by HughB When you power on the GPS there is a tag argument that registers your app wanting the gps to stay on. At that point only your app can turn off the gps. Posted at 2023-10-25 by @gfwilliams The idea is you mention your app/widget/code's name when you call setGPSPower - then Bangle.js keeps track and only turns the GPS off when no more apps need it. If you change apps (and fast load is off) then all that is lost and GPS is turned off automatically (if nothing in the new app says it needs GPS within 0.5s).
Should be very up to date as they are produced from the code, but it's a big project and sometimes comments don't always get updated like they should
As above, yes, it is (unless you set your app up to support 'fast load' in which case it should actively turn stuff off on exit). But realistically you should forget about that for now - fast load only really makes sense for clock apps.
Yes, exactly. Widgets, boot code, etc. The term |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-10-23 by charlie
I was hoping to understand abit more about what happens when you exit an app and return to the main screen and what role appID plays in functions like the one below, if any.
Is there an "onExit" type event you can subscribe to so can do things like saving app state before it closes?
If I don't set the app id is it auto injected?
How uptodate are the comments on functions like "setGPSPower"? I had assumed that once you exit an app to the main menu everything is reset to how it was before you opened the app. The comments kinda hint that multiple apps could be open at the same time. In what scenario would this happen? Widget?
Beta Was this translation helpful? Give feedback.
All reactions