4 ms·
Absent memory pressure, apps can stay open for up to 10 minutes in the background. The correct solution here is for the app to request background processing an
by lilyball 7y ago
Absent memory pressure, apps can stay open for up to 10 minutes in the background.
The correct solution here is for the app to request background processing and to schedule a local notification in 9 minutes saying that the app is about to run out of background time and pause (and then clean up the notification if the user returns to the app before it fires). This means you're not abusing anything, and it lets the user return before the connection is killed in order to keep it alive.
This also means if the user never returns, the app will naturally shut down the connection after 10 minutes instead of keeping it open indefinitely.
- saagarjha 7y agoUnder normal usage, iOS will kill apps a lot earlier than 10 minutes. In the general case it's really not possible to do this, and I would argue that shipping with a flaky feature is probably worse than not shipping with it at all.
- lilyball 7y agoI haven't checked in a while but in the past it was fairly reliably 10 minutes. In any case, there's a property `UIApplication.backgroundTimeRemaining` that tells you how long you have, so you can use that to calculate the appropriate notification time.
- throwaway55554 7y agoOne of the biggest complaints people have with ios13 right now is RAM management. It quickly kills off apps.
- htfu 7y agoI thought it was 3 minutes? Or is it 3 guaranteed, 10 maximum? And yes, the app in question of course does exactly that notification dance (I've used it since long before it got its current name). GP is talking about a new feature to keep sessions open in bg for a loong time. I've disabled it, not for fear of tracking but because it seems like a silly way to forget connections open and drain the battery for no reason. App has indeed also always supported mosh... me I just attach to tmux. But I agree with whoever wrote it's better to have such a bg hack feature than not, for those who find it useful.
- lern_too_spel 7y agoOr instead of using a hack that intermittently fails, you could use a platform that lets the app function correctly. The app can pester the user about if they want to keep the connection open only if the user specifically wants that. Termius works perfectly on Android without requesting my location.
- developer2 7y agoHint: if Apple allowed apps to run indefinitely in the background, it would be less than a month before almost every app "needs to run in the background", for user-unfriendly reasons. And battery life would drop to a couple of hours. This is why I'm an Apple user. Hate regarding Apple's policies like "use a platform that lets the app function correctly" (ie. drain battery running in background just to do more tracking, or because every developer assumes THEIR app is so special that it must never be unloaded from memory, in order to open instantly when being swapped back to... weeks after user's last interaction). With hilarious frequency, the complaints people have about Apple are precisely the reasons I prefer their products.
- lern_too_spel 7y ago> Hint: if Apple allowed apps to run indefinitely in the background, it would be less than a month before almost every app "needs to run in the background", for user-unfriendly reasons. And battery life would drop to a couple of hours. This doesn't happen on Android. The reason it doesn't is that the app has to display a persistent notification if it wants to run with high priority in the background. This is why I'm an Android user. It lets the user do what they need to do and prevents apps from being abusive. Every excuse for Apple's platforms failings that I have seen so far has a better solution on Android that the Apple apologist has not heard of.
- cerberusss 7y agoAre you sure about that? Especially in iOS 13, killing apps seems to have gotten a bit more agressive.
- freehunter 7y agoYeah on iOS 13 I get Safari tabs reloading if I toggle between them. Just switching to one tab and back to the other will sometimes completely reload the page. iPadOS was such a major leap forward for the iPad and there's not many features left I need to use it as a laptop replacement... but the aggressive app and tab killing ruins everything. I've never said this about iOS devices before, but it's time to start putting more RAM in these machines.