PurchaseController
An abstract class for handling custom purchase flows and subscription management.
Implementing a custom PurchaseController is advanced functionality. Most developers should use the default purchase controller with RevenueCat integration.
For RevenueCat integration, see the Using RevenueCat guide instead of implementing a custom PurchaseController.
Purpose
Allows custom implementation of purchase flows, subscription validation, and cross-platform purchase handling.
Signature
Parameters
Method | Parameters | Description |
---|---|---|
purchaseFromAppStore | productId: String | Handles iOS App Store purchases. |
purchaseFromGooglePlay | productId: String , basePlanId: String? , offerId: String? | Handles Google Play Store purchases with optional base plan and offer. |
restorePurchases | None | Restores previous purchases across platforms. |
Returns / State
purchaseFromAppStore
andpurchaseFromGooglePlay
returnFuture<PurchaseResult>
restorePurchases
returnsFuture<RestorationResult>
Usage
For most use cases, use RevenueCat integration instead:
See the Using RevenueCat guide for complete setup instructions.
Custom implementation is only needed for advanced use cases where you have your own purchase handling system.
How is this guide?