Connect your store and product catalog
- Create or select your Aplyna application. An Admin adds its Apple store configuration in Apps & API keys, using the app's exact bundle identifier and validated Apple credentials.
- Use the SDK key belonging to that iOS store configuration. A Test Store key can test catalog data and telemetry, but cannot authenticate a real store purchase.
- Import the actual store products into the selected app's catalog and map the intended subscription products to an entitlement. Choose monthly and annual products already configured in App Store Connect; the SDK does not create store subscriptions or free-trial eligibility.
- Verify the selected app's billing-service mapping, Sandbox environment and provider access with your Aplyna pilot setup before opening checkout. Credential validation alone does not complete purchase processing setup.
- Use an approved Apple Sandbox tester and a compatible native host. Keep existing production billing and subscriber access intact during evaluation.
Install the source SDK
Choose a fixed source snapshot from Versioned SDK downloads or use the platform guide's current source archive. Swift uses a local Swift package, React Native installs the extracted local npm package, and Flutter uses a path dependency. Rebuild with local Xcode for iOS. No Expo/EAS cloud service or Expo account is required; React Native's native billing module cannot run inside Expo Go.
Configure Sandbox billing
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();
const customerInfo = await Aplyna.billing.sync();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();
final customerInfo = await Aplyna.billing.sync();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
)
// Run in an async context.
let products = try await billing.mappedProducts()
let customerInfo = try await billing.syncPendingPurchases()Configure once per host app. Billing does not require enabling analytics consent. The Sandbox guard checks the verified App Store environment before purchase UI opens. Handle configuration, network and missing-product errors in the app; never replace a failed verification with local paid access.
Purchase, restore and check access
Render the actual returned product names and localized prices. Call purchase only after the user selects that product and taps your purchase action. Offer Restore purchases as a separate explicit action. The returned customer information contains server-verified entitlements; refresh it on launch and foreground.
Verify the first transaction
- Complete an explicit Apple Sandbox purchase in the native host and confirm its actual store product and environment.
- Check the matching Aplyna billing customer's returned entitlement, expiry and checkedAt. Inspect the same app's Sandbox customer and transaction records; do not use an analytics installation ID as a billing customer ID.
- Relaunch and restore, then test expiry, cancellation, grace, recovery and revocation for your own integration. Build checks and a visible paywall are not purchase acceptance.