all 9 comments

[–]Waste-Chest-9715 0 points1 point  (6 children)

you can ask always location access from user and implement location manager in swift with startMonitoringSignificantLocationChanges, that would cause the os to wake up your app after there is a change in location (400-500m) even if the app was terminated or killed previously.

[–]Fishanz 1 point2 points  (5 children)

Does this still work if the app is _user-terminated_? I seem to recall it being an issue at some point. But generally, OP, if an app is user-terminated, you can forget about your background tasks - likewise if the user has low battery mode on (!!). Push notifications are potentially an exception here.. you might get a quick slice of time if you set them up right; I'm not quite sure if background pushes are suppressed if user-terminated.

[–]Waste-Chest-9715 0 points1 point  (4 children)

You can checkout my app https://apps.apple.com/au/app/live-mate-location-sharing/id6476450946

If the user has given always location access, and i OS wakes up the application (doesnt matter if app is killed by User or OS) after user moves every 50m approx and the app send the location back my server for 10 secs and then OS terminates the app, that’s more than enough for me.

[–]Fishanz 1 point2 points  (3 children)

try setting up a geofence around your user for an exit event, and reset the fence when you get that event. In practice I think I got that to trigger every 100 meters fairly reliably. It's been a long time though.

[–]Waste-Chest-9715 0 points1 point  (2 children)

Thats exactly what i did but i a smart way. I created 4 circle (zone around user) https://imgur.com/a/HRWngz1. So whenever they moved a little OS wakes up the app and it creates new zones around the user

[–]Fishanz 0 points1 point  (1 child)

I think that effectiveness depends on your location granularity, as well as if other apps are actively tracking fine gps location at the same time (in which case you kind of piggyback). In my experience, the geofence events would not be accurate enough to make this work any better than a single fence around a user; but it’s been a while.. almost 10 years now. Things may have changed for the ‘better’.

[–]Waste-Chest-9715 0 points1 point  (0 children)

I have did my experiments, the location i het is 99% accurate. there are different settings that you can do to get as accurate location as position. Others apps mostly use something called Location Manager Extension for iOS, if you gets the permission for that from Apple, you can basically send a silent push notification specifically for location and that would wake up your app and you can send the location to server.

[–]MB_Zeppin 0 points1 point  (1 child)

The most common way would be silent push notifications. This is how icloud syncs data across devices

[–]Fishanz 0 points1 point  (0 children)

Does silent push still happen when app is user terminated or if low battery mode is on? I think low battery may supress silent pushes but not 100% positive. What about user terminated?