Add in-app purchases and subscriptions to your app.
Six steps take an iOS app from no billing to a verified Sandbox purchase: create products, map an entitlement, install the SDK, purchase, restore and check access. The code below is the core client integration in Swift, React Native or Flutter.
Add subscriptions in six steps.
- Create your products in App Store Connect. Create the subscription group and its monthly and annual products in App Store Connect. The store owns prices, free trials and offer eligibility. Connect Apple keys →
- Connect the store and map an entitlement. Add the app's Apple store configuration in Aplyna, import the products you chose and map them to one entitlement such as premium. Your app checks the entitlement, never a product ID. Billing quickstart →
- Install the SDK and configure billing. Add the Aplyna source SDK for Swift, React Native or Flutter and configure billing once with that store configuration's SDK key, in Sandbox. SDK downloads →
- Show products and start a purchase. Load the mapped products, show their localized prices, and call purchase only when the user taps your purchase button. Make a purchase →
- Offer Restore purchases. Add a separate Restore purchases action. It refreshes verified entitlements for the same customer. Restore purchases →
- Check the entitlement and test in Sandbox. Gate premium features on the server-verified entitlement, refresh it on launch and foreground, then test purchase, renewal, expiry and restore with an Apple Sandbox tester. Check entitlements →
The client code.
Configure once, load the mapped products, purchase from a user action, and read access from the returned entitlement. Replace premium with your own entitlement identifier.
import Aplyna from '@aplyna/react-native';
await Aplyna.billing.configure({
apiKey: 'YOUR_IOS_APP_SDK_KEY',
environment: 'sandbox',
sandboxOnly: true,
});
const products = await Aplyna.billing.products();
// Inside your purchase button handler:
const info = await Aplyna.billing.purchase(selectedProduct.id);
const hasPremium = info.entitlements.some((entitlement) =>
entitlement.identifier === 'premium' &&
entitlement.active &&
(entitlement.expiresAt === null ||
Date.parse(entitlement.expiresAt) > Date.now())
);
// Inside your Restore purchases handler:
await Aplyna.billing.restore();import 'package:aplyna/aplyna.dart';
await Aplyna.billing.configure(
apiKey: 'YOUR_IOS_APP_SDK_KEY',
environment: AplynaBillingEnvironment.sandbox,
sandboxOnly: true,
);
final products = await Aplyna.billing.products();
// Inside your purchase button handler:
final info = await Aplyna.billing.purchase(selectedProduct.id);
final hasPremium = info.hasAccessTo('premium');
// Inside your Restore purchases handler:
await Aplyna.billing.restore();import Foundation
import Aplyna
let billing = try AplynaBillingClient(
gatewayURL: URL(string: "https://aplyna.com/api/billing")!,
sdkKey: "YOUR_IOS_APP_SDK_KEY",
environment: .sandbox,
sandboxOnly: true
)
let products = try await billing.mappedProducts()
// Inside your purchase button action:
let info = try await billing.purchase(selectedProduct)
let hasPremium = info.hasAccess(to: "premium")
// Inside your Restore purchases action:
_ = try await billing.restorePurchases()A cancelled or pending purchase grants nothing, and a failed verification must never be replaced with local paid access.
Pick your framework.
- Swift and SwiftUI: a local Swift package.
- React Native: an extracted local npm package and a native rebuild.
- Flutter: a path dependency.
- Android: Play Billing is under device validation and is not a validated billing release.
Five words you need.
- Product
- One item on one store, such as a monthly subscription in App Store Connect.
- Entitlement
- The access your app checks, such as premium. Several products can unlock it.
- Restore
- Re-reading the customer's store purchases so access returns after a reinstall.
- Sandbox
- The store's test environment. Purchases are free and renew on a short clock.
- Server verification
- Checking the store's signed transaction on a server before granting access.
Let your coding assistant set it up.
Download the Aplyna billing skill for Codex or Claude Code, then ask for a subscription integration. The skill follows these same steps and states which platforms are released.
Set up billing with Codex or Claude Code →What is not released yet.
Aplyna billing is an early-access iOS pilot. Android purchases, public registry packages, cross-device subscriber migration and commercial pricing are still release work. If you need both stores in production today, compare the established providers first.
In-app purchases: common questions.
Do I need a backend to add in-app purchases?
For an iOS-only app, StoreKit 2 can verify purchases on the device. You need a server, your own or a provider's, when access must follow the user across devices or stores, or when you want refunds and renewals reflected without the app open.
Which platforms does Aplyna billing support?
The current billing pilot is iOS, through Swift, React Native and Flutter source SDKs. Android billing is under device validation and is not a validated release.
Can I install Aplyna from npm, pub.dev or Swift Package Manager?
Not from a public registry yet. The SDKs are downloadable source packages with SHA-256 checksums: a local Swift package, an extracted npm package and a Flutter path dependency.
Does Aplyna work in Expo Go?
No. The React Native SDK has a native billing module, so it needs a native build made with local Xcode. Expo's cloud build services are not required.
How much does Aplyna cost?
Aplyna is in early access and free while your apps make less than $2,500 in monthly tracked revenue. In months that reach $2,500, the fee is 1% of the first $10,000, with lower rates on the revenue above. Creating an account does not start a paid subscription.
Can a coding assistant set this up?
Yes. Aplyna publishes a billing skill for Codex and Claude Code that follows the documented install, purchase, restore and entitlement steps.