Miniwall Docs
Mobile SDK

Quickstart

Show a screen from a placement in your app, pass it prices, and run your own purchase code when someone buys.

This page takes you from a published screen to a working screen in your app. It uses a placement, so you can change the screen later without a release.

What you need

  • A published screen and a placement that points at it. See Placements.
  • A public key from Install SDK or API keys.
  • The IDs of the packages on the screen. Each package card has an ID set in the editor (see Packages and pricing). The Install SDK page lists them for the screen you pick.

Show the screen

Install the SDK and call configure once at startup with your key.

Present the placement from a button. Pass a price for every package ID on the screen, and run your purchase in onPurchase.

var options = PresentOptions()
options.products = [
    "monthly": ProductInfo(price: 9.99, currency: "USD", period: .every(.month)),
    "annual": ProductInfo(price: 59.99, currency: "USD", period: .every(.year)),
]
options.onPurchase = { request in
    // Your purchase (StoreKit, your billing library, your backend...).
    // Return true when bought, false when the user cancelled. Throw on failure.
    try await buy(request.packageId)
}

let result = try await Miniwall.present(placement: "upgrade_button", options: options)

Handle the result. present always finishes with a result that tells you what happened:

switch result {
case let .purchased(packageId, _): unlockPro(packageId)
case let .skipped(reason): print("Not shown:", reason)
default: break
}

That is a complete integration. The screen opens in the format you chose on the placement, shows your prices, calls onPurchase when the user taps buy, and closes.

Results you can get

ResultWhenExtra fields
purchasedonPurchase finished without returning false.packageId, answers
restoredonRestore finished without returning false.answers
closedThe user closed the screen (close button, swipe down, system back, or a toast timing out).answers
actionA "Run your code" button was pressed and onAction did not return false.actionId, answers
skippedThe placement's targeting chose to show nothing. Nothing opened.reason: frequency_cap, audience or holdout

Make it show by itself

If you set a trigger on the placement (for example "When the app opens"), call startAutoPlacements once instead of calling present yourself. See Auto placements.

Show a screen inline

Put a screen inside your own layout, like an onboarding step or a pricing section, with MiniwallView (SwiftUI) or MiniwallScreen (Compose). See Embed a screen.

If something does not show

  • present throws Miniwall: call Miniwall.configure(...) before loading a placement when configure was not called.
  • Placement not found means the key does not match a placement. Published paywall not found means the screen was never published.
  • See Errors for every message.

On this page