Tutorial: your first app
Install the Horse iOS SDK
The Horse iOS SDK is the open-source HorseKit Swift package. It runs on iOS 15, macOS 12, tvOS 15, watchOS 8 and visionOS 1 or later, and it's split into libraries so your app links only what it uses.
#Add the package
Open Add Package Dependencies
In Xcode, choose File → Add Package Dependencies… and paste the package URL:
https://github.com/HorseRevenue/horsekit-iosPick the version rule
Choose Up to Next Major Version from 2.0.0. You get fixes and new features as they're released, and never a breaking change without warning.
Add the libraries to your app target
Tick HorseKit, and HorseKitUI if you designed a paywall in step 6. Add the others only if you need them (see below).
Using a Package.swift instead:
dependencies: [
.package(url: "https://github.com/HorseRevenue/horsekit-ios.git", from: "2.0.0"),
],
targets: [
.target(name: "YourApp", dependencies: [
.product(name: "HorseKit", package: "horsekit-ios"), // always
.product(name: "HorseKitUI", package: "horsekit-ios"), // paywalls designed in the dashboard
]),
]#Which libraries
| Library | What's in it | Add it when |
|---|---|---|
HorseKit | Purchases, entitlements, offerings, remote config, experiments, access codes, analytics. Links StoreKit only. | Always |
HorseKitUI | Paywalls designed in the dashboard, drawn natively (PaywallView) | You show a designed paywall |
HorseKitSearchAds | Apple Search Ads attribution. Links AdServices, with no tracking prompt. | You run Apple Search Ads campaigns |
HorseKitAttribution | For apps that run ads: IDFA, App Tracking Transparency status and ad-network ids. Includes HorseKitSearchAds. | You run Meta or other ad campaigns |
Most apps add HorseKit and HorseKitUI.
Each library is imported on its own. A file that shows a designed paywall imports both:
import HorseKit
import HorseKitUI#Upgrading from 1.x
Version 2.0 renamed the libraries. Replace import HorseKitCore with import HorseKit. If your app used the all-in-one HorseKit from 1.x, add HorseKitUI for paywalls and HorseKitAttribution for the ad-tracking helpers, and import them where you use them. Nothing else changed. The changelog has the details.