Commit Graph

24 Commits

Author SHA1 Message Date
Adrian Schönig 6bd6092fb4
Robustness: Run GeoMonitor on MainActor (#6)
* Robustness: Run GeoMonitor on MainActor

* Test compile fix
2023-05-29 11:22:05 +10:00
Adrian Schönig 18fcf08c36
Adds optional setting to require precise accuracy (#5) 2023-05-28 23:58:11 +00:00
Adrian Schönig 03f3cab0ee
Allow adding to iOS 13 project (though GeoMonitor remains iOS 14+) (#4) 2023-01-26 22:30:49 +00:00
Adrian Schoenig 4e455745e6 Add podspec 2023-01-20 09:53:41 +11:00
Adrian Schoenig 7fbd9c1c56 Rename file for consistency 2023-01-20 09:31:02 +11:00
Adrian Schönig 5acfe17e8b
Create LICENSE 2023-01-20 09:25:46 +11:00
Adrian Schönig c411962ede
Tweaks docs and GHA (#3) 2023-01-19 03:34:57 +00:00
Adrian Schoenig 228062267a Avoid duplicated work when first scheduling an update, but then updating now
Also might help with duplicated calls to update
2022-12-08 18:10:09 +11:00
Adrian Schönig 46fedf24a9
Robustness (#2)
* Only calculate distances once per region and re-use the same then

And sort by priority if current location couldn't get fetched

* Add tests and GHA

* Trying to fix GHA
2022-09-15 16:51:05 +10:00
Adrian Schoenig 6902d63ff3 Dealing with large numbers of regions:
- If there are many within 5km, order those by priority
- Avoid duplicated re-monitoring if called again within 2.5s
- Fall back to known current location, if none provided
2022-09-14 11:59:56 +10:00
Adrian Schoenig b0dc979c5c Upgrade debug messages to status messages 2022-08-31 16:43:49 +10:00
Adrian Schoenig ab1aa0051f Refine background modes:
- Set `allowsBackgroundLocationUpdates` immediately, to get the blue
  pill when using "When in use" permissions.
- Avoid duplicate location checks when triggering `checkIfInRegion`
- Don't monitor regions when `!isMonitoring` and ignore callbacks
  after setting `isMonitoring = false`

Also: Comments
2022-08-18 17:31:12 +10:00
Adrian Schoenig 7f11da6b83 Avoid reporting duplicate regions 2022-08-08 11:37:37 +10:00
Adrian Schoenig 9416be5e5c Add `checkIfInRegion` which causes a `.manual` trigger event 2022-06-29 15:43:07 +10:00
Adrian Schönig 6d30a0ac03
Don't keep all monitored regions, but always re-evaluate which should be kept, and also remove some that are far away, even if they are still valid. (#1) 2022-06-29 15:42:07 +10:00
Adrian Schoenig 5c6efad6d4 Use same current location radius while debugging 2022-06-21 14:20:07 +08:00
Adrian Schoenig 2b60c41842 Fixes for `enableInBackground`
- Fix asking for "always" permissions when not yet determined
- Allow disabling
- Allow saving value to user defaults
2022-06-07 14:54:44 +10:00
Adrian Schoenig b096c11bce Clean-up, removing debug code 2022-06-06 18:32:28 +10:00
Adrian Schoenig 97111de1cf Tweak fetching current location 2022-06-06 14:12:18 +10:00
Adrian Schoenig 595a44526d Add timeout when fetching current location 2022-06-02 13:15:48 +10:00
Adrian Schoenig bf411c9c40 Error handling robustness
- Don't fetch if we know we don't have access
- Allow fetching current location in parallel

Also: Comments and README info
2022-05-27 17:33:07 +10:00
Adrian Schoenig 7ccc0c911c Tweak monitoring of regions
- Provide a method to update the latest regions
- Don't monitor far away regions
- Stop monitoring outdated regions
2022-05-25 13:10:03 +10:00
Adrian Schoenig 41c609b8cb Import GeoMonitor code 2022-05-23 17:12:01 +10:00
Adrian Schoenig aafb17b10a spm init 2022-05-23 16:57:11 +10:00