Skip to content
AppDues
Log in
Contact salesSign up

Build subscription apps faster

Subscriptions on iOS and Android mean two billing systems, receipt handling, entitlement checks, and a way to see what actually happened when a purchase fails.

A subscription SDK and backend can take that plumbing off your plate so the app code focuses on showing products, completing a purchase, and unlocking the right content.

Field and control map

The three code tabs correspond to three distinct jobs. Treat them as a sequence, not alternatives.

  • Fetch offerings (control: Fetch offerings) calls Purchases.shared.getOfferings and reads offerings?.current?.availablePackages to get the list of packages to display.
  • Make purchases (control: Make purchases) calls Purchases.shared.purchase(package:) and returns transaction, customerInfo, error, and userCancelled.
  • Check subscription status (control: Check subscription status) calls Purchases.shared.getCustomerInfo to read the latest customerInfo.

The unlock decision is made from customerInfo.entitlements["your_entitlement_id"]?.isActive == true. The entitlement ID is a placeholder that must be replaced with the real configured identifier; it is not a value to hardcode from this page.

Telling failures apart

The purchase callback returns four values, and they answer different questions:

  • userCancelled is true when the person backed out of the store sheet. That is not an error and usually should not show an error message.
  • error is non-nil when the purchase itself failed (network, store, or configuration). Surface it and log it.
  • transaction describes what the store reported for this attempt.
  • customerInfo is the source of truth for access. Even a successful purchase only unlocks content when the entitlement is active.

A common mistake is to unlock on transaction != nil alone. Check the entitlement instead, and re-fetch customerInfo on launch and on resume so access reflects the latest state.

Debugging with confidence

Sandbox testing, detailed logs, and real-time debugging tools let you watch purchases and subscriptions at every step. Use sandbox accounts to exercise the purchase path before release, and read the logs when a purchase succeeds in the store but the entitlement does not activate. Logs and sandbox testing help you narrow down whether the issue sits in the app's fetch/purchase call, the product mapping in the dashboard, or the entitlement configuration.

REST API and webhooks

The source lists three server-side capabilities: full access to subscription data via the REST API, webhooks for real-time events, and the pieces needed to build custom integrations and backend workflows. A practical split is to use the API for reads and backfills — syncing entitlement state to your own database or reconciling purchases with an internal billing record — and to use webhooks for event-driven reactions such as triggering lifecycle emails when a renewal or cancellation arrives.

ConfigureTargetTest

Where to get help

The source points to a community forum for questions and answers, a space for sharing ideas and connecting with other developers, and a place to read the latest feature releases and updates. Documentation covers installation, the API reference, sample apps, and migration paths. Support response times and channel commitments are not asserted here; see the owner-input template below.

Plan, pricing, and support commitments

The following items require owner confirmation before publication and are not asserted here:

  • Free tier limits and paid plan prices: {{OWNER_PLAN_PRICING}}
  • Support response times and channels: {{OWNER_SUPPORT_COMMITMENT}}
  • Community forum and feature-release channels: {{OWNER_COMMUNITY_CHANNELS}}
  • Any guarantee about billing API changes or migration assistance: {{OWNER_GUARANTEE_TERMS}}
  • Customer counts or adoption claims: {{OWNER_ADOPTION_FIGURES}}
  • Testimonials and customer stories: {{OWNER_TESTIMONIALS}}
  • Trial length and cancellation terms: {{OWNER_TRIAL_TERMS}}

Frequently asked questions

Should I unlock content when the purchase transaction succeeds?

No. Unlock only when the entitlement is active, for example customerInfo.entitlements["your_entitlement_id"]?.isActive == true. A transaction can succeed while the entitlement is not yet active, and a restored purchase has no new transaction at all.

How do I tell a user cancellation from a real error?

The purchase callback returns userCancelled separately from error. If userCancelled is true, the person dismissed the store sheet; do not show an error. If error is non-nil, the purchase failed and should be logged and surfaced.

Which platforms does the Purchases SDK support?

The SDK is described as supporting all major platforms and frameworks, with iOS, Android, React Native, Flutter, and Unity named explicitly, plus first-class TypeScript support.

When should I use the REST API versus webhooks?

Use the REST API when you need to read or backfill subscription data. Use webhooks when you need to react to events in real time, such as renewals or cancellations, without polling.