horse revenue Docs

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

  1. Open Add Package Dependencies

    In Xcode, choose File → Add Package Dependencies… and paste the package URL:

    https://github.com/HorseRevenue/horsekit-ios
  2. Pick 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.

  3. 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:

Package.swift
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

LibraryWhat's in itAdd it when
HorseKitPurchases, entitlements, offerings, remote config, experiments, access codes, analytics. Links StoreKit only.Always
HorseKitUIPaywalls designed in the dashboard, drawn natively (PaywallView)You show a designed paywall
HorseKitSearchAdsApple Search Ads attribution. Links AdServices, with no tracking prompt.You run Apple Search Ads campaigns
HorseKitAttributionFor 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.

#What's next

Configure the SDK at launch and check access.