Tweaks docs and GHA (#3)

This commit is contained in:
Adrian Schönig 2023-01-19 14:34:57 +11:00 committed by GitHub
parent 228062267a
commit c411962ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 15 deletions

View File

@ -8,11 +8,17 @@ on:
jobs: jobs:
macos: macos:
runs-on: macos-11 # macos-latest is still 10.15, which we don't support runs-on: macos-12 # macos-latest is still 10.15, which we don't support
steps: steps:
- uses: actions/checkout@v2 - uses: maxim-lobanov/setup-xcode@v1
- uses: devbotsxyz/xcode-select@v1.1.0
with: with:
version: latest xcode-version: latest-stable
- uses: actions/checkout@v3
- name: Build & Test - name: Build & Test
run: xcodebuild -scheme 'GeoMonitor' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13' run: xcodebuild test -scheme 'GeoMonitor' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -resultBundlePath TestResults
- uses: kishikawakatsumi/xcresulttool@v1.7.0
with:
path: TestResults.xcresult
if: success() || failure()
# ^ This is important because the action will be run
# even if the test fails in the previous step.

View File

@ -15,15 +15,8 @@ Relies on a mixture of techniques, such as:
- Go to *Signing & Capabilities*, *Background Modes* and make sure *Location updates* is ticket. - Go to *Signing & Capabilities*, *Background Modes* and make sure *Location updates* is ticket.
- Go to *Info*, and make sure you have usage descriptions for "Privacy - Location Always", "Privacy - Location Always and When in Use", and "Privacy - Location When In Use" set. - Go to *Info*, and make sure you have usage descriptions for "Privacy - Location Always", "Privacy - Location Always and When in Use", and "Privacy - Location When In Use" set.
## Usage ## Usage
TODO:
- [ ] Optional: Set maximum number of regions for GeoMonitor to use. If this
is not specified, it'll use the maximum of 20. Set this if you're
monitoring regions yourself.
```swift ```swift
self.monitor = GeoMonitor { self.monitor = GeoMonitor {
// Fetch the latest regions; also called when entering one. // Fetch the latest regions; also called when entering one.
@ -42,15 +35,12 @@ self.monitor = GeoMonitor {
// Called when a visit was registered // Called when a visit was registered
} }
} }
monitor.maxRegionsToMonitor = 18
monitor.enableVisitMonitoring = true monitor.enableVisitMonitoring = true
monitor.start() monitor.start()
``` ```
## Considerations ## Considerations
TODO:
Regular iOS restrictions apply, such as: Regular iOS restrictions apply, such as:
> [...] When Background App Refresh is disabled, either for your app or for all apps, the user must explicitly launch your app to resume the delivery of all location-related events. > [...] When Background App Refresh is disabled, either for your app or for all apps, the user must explicitly launch your app to resume the delivery of all location-related events.