Development mode
Test purchases and access in debug builds without App Store Connect.
Development mode lets a debug build buy from a simulated store while Voidhash processes the purchases for real. Use it to test your purchase flow, paywalls and access checks in the Simulator or on a device before you connect App Store Connect.
Simulated purchases are recorded in the test environment and never unlock access in production
or count toward production revenue. See
Environments.
Turn it on
- In Studio, create a product and attach its perks. A subscription product needs a billing duration, which sets its simulated renewal and expiry dates. You don't need to connect the App Store.
- Make sure Settings → General → Simulated purchases → Enable simulated purchases is on. It is by default.
- Set
devand the test publishable key in debug builds:
import Voidhash
func configureVoidhash() {
var options = VoidhashOptions()
#if DEBUG
options.dev = true
let publishableKey = "vh_pk_test_..."
#else
let publishableKey = "vh_pk_..."
#endif
Voidhash.configure(publishableKey: publishableKey, options: options)
}Voidhash refuses simulated purchases made with a production key. The dev option is honored only
when the SDK is compiled in a debug configuration; release builds always use StoreKit. You don't
need debug as well.
How it behaves
getProducts()returns every product in the project, priced as in Test prices, without asking the App Store.- A purchase shows a confirmation sheet instead of the App Store sheet, waits briefly, and refreshes the person once Voidhash accepts it.
- Paywalls buy through the same simulated store.
- A purchase with an
offerIdbuys the product at its test price. presentCodeRedemptionSheet()andshowManageSubscriptions()throwMETHOD_NOT_AVAILABLE_PLATFORM.- In observer mode,
purchase(product:)still throwsREAD_ONLY_PURCHASE_NOT_ALLOWED.
Test prices
Simulated purchases use fixed USD prices:
| Product | Price |
|---|---|
| Weekly subscription | $4.99 |
| Monthly subscription | $9.99 |
| Quarterly subscription | $24.99 |
| Six-month subscription | $39.99 |
| Annual subscription | $49.99 |
| Non-consumable | $19.99 |
| Consumable | $4.99 |
A subscription without a duration is simulated as monthly, with a warning.
Simulate renewals and refunds
Move a simulated purchase through its lifecycle with the CLI:
voidhash sandbox view user_123
voidhash sandbox renew user_123
voidhash sandbox grace-period user_123
voidhash sandbox expire user_123
voidhash sandbox refund user_123
voidhash sandbox revoke user_123The CLI isn't published to a package registry yet. The same actions work through the MCP server and the HTTP API; see Simulate renewals, expiry and refunds.
renew, expire and grace-period (3 days) apply to subscriptions, refund to one-time
purchases, and revoke to both. Pass the product slug when the person has several.
voidhash sandbox reset deletes every simulated purchase in the project; so does Settings →
General → Simulated purchases → Delete. Neither touches production, sandbox, Stripe test mode or
payment source test purchases. In Studio, choose Test in the environment switcher to see
simulated purchases.
Next steps
- Test purchases (Help center) with App Store sandbox accounts and TestFlight.
- Connect the App Store (Help center)
- Make and restore purchases
Something wrong or missing on this page? Tell us by email or on Discord.