Quickstart
Get AppActor running in your app in three steps.
Step 1: Install the SDKโ
- iOS
- Android
- Flutter
- React Native
// In Xcode: File > Add Package Dependencies
// Enter the repository URL:
// https://github.com/appactor/appactor-ios.git
// Or in Package.swift:
dependencies: [
.package(url: "https://github.com/appactor/appactor-ios.git", from: "1.0.0")
]
Coming Soon
Android SDK is currently in development.
Coming Soon
Flutter SDK is currently in development.
Coming Soon
React Native SDK is currently in development.
Step 2: Configure the SDKโ
Initialize AppActor when your app launches. You only need your API key from the AppActor dashboard.
- iOS
- Android
- Flutter
- React Native
import AppActor
@main
struct MyApp: App {
init() {
AppActor.configure(apiKey: "pk_live_your_key_here")
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Coming Soon
Android SDK is currently in development.
Coming Soon
Flutter SDK is currently in development.
Coming Soon
React Native SDK is currently in development.
Step 3: Make a Purchaseโ
Fetch offerings, display products, and handle purchases.
- iOS
- Android
- Flutter
- React Native
// Wait for bootstrap if you need guaranteed initial data
await AppActor.shared.awaitBootstrap()
// Fetch server-driven offerings
let offerings = try await AppActor.shared.offerings()
guard let package = offerings.current?.monthly else { return }
// Display price
Text(package.localizedPrice) // e.g. "$9.99/month"
// Make a purchase
let result = try await AppActor.shared.purchase(package: package)
switch result {
case .success(let customerInfo):
if customerInfo?.hasActiveEntitlement("premium") == true {
// Unlock premium features
}
case .pendingServerValidation:
// Receipt is queued and will retry automatically
// You can call syncPurchases() manually if needed
case .cancelled:
break // User cancelled
case .pending:
break // Pending (Ask to Buy, SCA)
case .failedServerValidation(let code, let message, let requestId):
print("Validation failed [\(code ?? "unknown")] requestId=\(requestId ?? "n/a")")
print(message ?? "Receipt could not be validated")
}
Coming Soon
Android SDK is currently in development.
Coming Soon
Flutter SDK is currently in development.
Coming Soon
React Native SDK is currently in development.
Next Stepsโ
- Configuring the SDK โ Learn about configuration options and payment mode
- Identifying Users โ Set up user identity
- Displaying Products โ Learn about offerings, packages, and products