Snowplow event tracker for Apple platforms written in Swift.
The Snowplow Swift Tracker is available through Swift Package Manager. You can follow the guide published by Apple to add it to your Xcode project.
Events are sent through an instance of Tracker
, which needs to be initialized with an Emitter
.
let emitter = Emitter(baseURL: "SNOWPLOW_URL")
let tracker = Tracker(applicationId: "APP_ID", emitter: emitter)
The tracker tests need to be validated using an instance of Snowplow Micro running locally. The easiest way to run Snowplow Micro locally is with Docker and Colima.
Install Docker and Colima via Homebrew:
# Install Docker
brew install docker-credential-helper docker
# Install Colima
brew install colima
To run Snowplow Micro:
# Start Colima
colima start
# Run Snowplow Micro
docker run -p 9090:9090 snowplow/snowplow-micro:2.1.3-distroless
# Stop Colima
colima stop
Open Snowplow Micro in a web browser to validate the payloads sent from the tracker:
http://localhost:9090/micro/ui/