Checking Entitlement Status
Use CustomerInfo to check what the user has access to. The SDK keeps this updated in real-time.
Basic Checkโ
- iOS
- Android
- Flutter
- React Native
// Simple boolean check
if AppActor.shared.customerInfo.entitlements["premium"]?.isActive == true {
showPremiumContent()
} else {
showPaywall()
}
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.
Getting Fresh Dataโ
- iOS
- Android
- Flutter
- React Native
// Uses 5-minute cache (fast, usually sufficient)
let info = await AppActor.shared.getCustomerInfo()
// Force refresh from StoreKit / server
let info = await AppActor.shared.getCustomerInfo(forceRefresh: true)
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.
Reactive Updates (SwiftUI)โ
AppActor.shared is an ObservableObject with @Published properties. SwiftUI views automatically re-render when customerInfo changes.
- iOS
- Android
- Flutter
- React Native
struct ContentView: View {
@ObservedObject var appActor = AppActor.shared
var body: some View {
Group {
if appActor.customerInfo.entitlements["premium"]?.isActive == true {
PremiumView()
} else {
FreeView()
}
}
}
}
struct PaywallView: View {
@ObservedObject var appActor = AppActor.shared
var isPremium: Bool {
appActor.customerInfo.entitlements["premium"]?.isActive == true
}
var body: some View {
if isPremium {
Text("You have premium access!")
} else if let offerings = appActor.offerings?.current {
// Show purchase options
ForEach(offerings.packages) { package in
BuyButton(package: package)
}
}
}
}
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.
Detailed Entitlement Infoโ
- iOS
- Android
- Flutter
- React Native
let info = AppActor.shared.customerInfo
if let premium = info.entitlements["premium"] {
// Access level
print("Active: \(premium.isActive)")
// Subscription details
print("Product: \(premium.productID ?? "none")")
print("Period: \(premium.periodType)") // .monthly, .annual, etc.
print("Expires: \(premium.expirationDate?.description ?? "never")")
print("Will renew: \(premium.willRenew)")
// Billing issues
print("Grace period: \(premium.isInGracePeriod)")
print("Billing retry: \(premium.isInBillingRetry)")
print("Revoked: \(premium.isRevoked)")
// Ownership
print("Family shared: \(premium.ownershipType == .familyShared)")
}
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.
Multiple Entitlementsโ
- iOS
- Android
- Flutter
- React Native
let info = AppActor.shared.customerInfo
// Check multiple entitlements
let hasPremium = info.entitlements["premium"]?.isActive == true
let hasPro = info.entitlements["pro"]?.isActive == true
// Gate features based on entitlement tier
if hasPro {
showProFeatures()
} else if hasPremium {
showPremiumFeatures()
} else {
showFreeFeatures()
}
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.
Handling Expirationโ
- iOS
- Android
- Flutter
- React Native
if let premium = info.entitlements["premium"] {
if premium.isActive {
if !premium.willRenew {
// Active but won't renew โ show retention offer
showRetentionOffer(expiresAt: premium.expirationDate)
}
} else if premium.isInBillingRetry {
// Payment failing โ prompt user to update payment method
showUpdatePaymentPrompt()
} else {
// Expired โ show paywall
showPaywall()
}
}
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.
Best Practicesโ
- Check entitlements, not products โ Use
entitlements["key"]?.isActiveinstead of checking product IDs - Use reactive updates โ In SwiftUI, observe
AppActor.sharedto automatically react to changes - Call
onAppForeground()โ Refresh state when the app returns to the foreground - Handle grace period โ Decide whether to grant access during payment issues
- Cache is OK โ The 5-minute cache is usually fresh enough. Only force refresh for critical checks.
Next Stepsโ
- Remote Config โ Server-driven feature flags
- Experiments โ A/B testing