horse revenue Docs

Tutorial: your first app

Make an offering

An offering is the set of plans a paywall sells, such as weekly, yearly and lifetime, in the order the paywall shows them. Because your app reads the offering at runtime, you can change the plans without a release.

#Create it

  1. Add an offering

    Open Monetization → Offerings and choose Add offering. Give it an Offering ID such as default. Coming from RevenueCat? Use the same id it had there.

  2. Add the packages

    A package is one plan, pointing at one product. Use the standard identifiers so the SDK can find them by name: $rc_weekly, $rc_monthly, $rc_annual and $rc_lifetime. For anything else, choose + custom package and name it yourself. Drag the packages into the order the paywall should show them.

  3. Make it current

    Switch on current offering. It's what your app gets when it asks for the current offering, and what every placement sells unless you say otherwise.

An offering with weekly, yearly and lifetime packages, in the demo workspace.
An offering with weekly, yearly and lifetime packages, in the demo workspace.

#Custom fields

Custom fields hold anything your paywall needs that isn't a price: a headline, a flag, a layout. Define them once for the app, switch on the ones this offering uses, and read them in the app:

let offering = try await Horse.shared.offerings().current
let headline = offering?.string("headline", default: "Go Pro")
let showClose = offering?.bool("show_close_button", default: true)

A designed paywall doesn't need custom fields for its words, since those are part of the design. They're for apps that draw their own paywall, or for settings the app reads around it.

#Placements

A placement is a place in your app where a paywall opens: onboarding, settings, export. Each placement sells an offering. By default that's the current one, and you can choose another on Offerings → Placements.

Name your placements now, even if they all sell the same offering. Later you can give one of them a different offering, or put it in an experiment, without a release.

let onboarding = try await Horse.shared.offerings().currentOffering(forPlacement: "onboarding")

#What's next

Design the offering's paywall, or skip to installing the SDK if you'll keep the paywall your app already has.