owntracks / ios

OwnTracks' iPhone App
http://owntracks.org
Other
315 stars 90 forks source link

Prevent offloading? #753

Closed giddyhup closed 4 months ago

giddyhup commented 7 months ago

I am a very happy user of Owntracks. I am aware this is more of an OS issue but perhaps there is something that can be done on the app side.

I have one user who has activated iOS's app offloading feature. It seems that, even though Owntracks does its job nicely in the background, iOS assumes it is an unused app and keeps offloading it. Is there something the app can do to show that it is actually being used?

ckrey commented 7 months ago

I have never experienced offloading...

In which mode do you use OwnTracks? (Significant Changes?) Do you have Background Refresh enabled for OwnTracks? Do you have any regions setup to be monitored?

When I check the Battery consumption in Settings, OwnTracks has about 6% background activity on my devices.

giddyhup commented 7 months ago

The mode is Significant Changes. I think offloading happens to save memory not power.

hepcat72 commented 5 months ago

Offloading doesn't save memory. It saves disk space. I don't think there's a way to prevent the phone from offloading the app. If it's not brought to the foreground every once in awhile, I don't think there's a way to prevent the offload. This is why I never turn on offloading. It was happening to me with Life360 and it stopped my location-triggered automations.

The only thing I can suggest is creating a personal automation in the shortcuts app to open the app every once in awhile based on some trigger (when the phone is unlocked), though I'm not actually sure if it's possible to do this without "ask before running", which would thwart the automation. I haven't tried it yet myself. A trigger I could suggest might be like, when turning off low power mode.

jpmens commented 5 months ago

Offloading saves "disk" space as the app is actually deleted from phone storage, leaving settings and data intact. When the app is opened, iOS attempts to re-download from the App Store. Note the word "attempt".

There doesn't seem to be a mechanism by which an app can prevent it being offloaded (which wouldn't really make any sense).

@hepcat72's suggestions may or may not work, but is this all really worthwhile for saving a few dozen/hundred/thousand megabyte? (which aren't really "saved" as the app will be downloaded again when opened).

hepcat72 commented 5 months ago

I just learned that iOS 17 mitigates the annoying lack of the "ask before running" toggle for certain automation triggers. (I now plan to update next chance.)

The trick with picking the right trigger with this issue is you want a trigger that will happen only when the phone is unlocked and you don't want it to be so frequent so as to be overly annoying. That's a difficult balance to strike.

But I sympathize with your family member. I have had a phone that was tight on disk space before and offloading can really save you sometimes. What Apple needs to do is provide a way to either manually select to make certain apps off limits to offloading or have offloading respect background activity.

giddyhup commented 5 months ago

@hepcat72, @jpmens, thank you for your thoughtful feedback. Yes, I meant storage and not memory. An automation is an interesting idea. For the time being we chose a manual approach where the family member checks if the app is still there. Since it is used for presence detection and the heat won't go up without it there is an incentive to have the app on the phone. : )

The demand for being able to exclude specific apps from being offloaded is widely discussed in many forums.

ckrey commented 4 months ago

It does not seem to be an app issue, but a request to Apple(iOS) for convenience. Closing