Just a simple iOS SDK Example/Template for iOS 13.0+
Initialize GeoPosterService
with an API key:
import GeoPoster
let service = GeoPosterService("123")
And post a location from a CoreLocation manager to the server with the log
method:
import CoreLocation
do {
let location = CLLocationCoordinate2D(latitude: 0, longitude: 0)
let response = try await service.log(location, time: .now, extra: "A note")
print(response)
} catch {
print(error)
}
If successful, service.log
will return a GeoPosterResponse
object.
To execute package tests use: ⌘ + U
.
Add GeoPoster to your project with:
dependencies: [
.package(url: "https://github.com/maxhumber/GeoPoster.git", .upToNextMajor(from: "1.0"))
]