flutter_inapp_purchase library
Classes
- ActiveSubscription
- AndroidSubscriptionOfferInput
- AppTransaction
- BillingProgramAvailabilityResultAndroid
- Result of checking billing program availability (Android) Available in Google Play Billing Library 8.2.0+
- BillingProgramReportingDetailsAndroid
- Reporting details for transactions made outside of Google Play Billing (Android) Contains the external transaction token needed for reporting Available in Google Play Billing Library 8.2.0+
- ConnectionResult
- Connection result (legacy - kept for backward compatibility)
- DeepLinkOptions
- DeveloperBillingOptionParamsAndroid
- Parameters for developer billing option in purchase flow (Android) Used with BillingFlowParams to enable external payments flow Available in Google Play Billing Library 8.3.0+
- DeveloperProvidedBillingDetailsAndroid
- Details provided when user selects developer billing option (Android) Received via DeveloperProvidedBillingListener callback Available in Google Play Billing Library 8.3.0+
- DiscountAmountAndroid
- Discount amount details for one-time purchase offers (Android) Available in Google Play Billing Library 7.0+
- DiscountDisplayInfoAndroid
- Discount display information for one-time purchase offers (Android) Available in Google Play Billing Library 7.0+
- DiscountIOS
- Discount information returned from the store. @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. @see https://openiap.dev/docs/types#subscription-offer
- DiscountOffer
- Standardized one-time product discount offer. Provides a unified interface for one-time purchase discounts across platforms.
- DiscountOfferInputIOS
- DiscountOfferIOS
- iOS DiscountOffer (output type). @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. @see https://openiap.dev/docs/types#subscription-offer
- EntitlementIOS
- ErrorCodeUtils
- Utility functions for error code mapping and validation
- ExternalOfferAvailabilityResultAndroid
- External offer availability result (Android) @deprecated Use BillingProgramAvailabilityResultAndroid with isBillingProgramAvailableAsync instead Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
- ExternalOfferReportingDetailsAndroid
- External offer reporting details (Android) @deprecated Use BillingProgramReportingDetailsAndroid with createBillingProgramReportingDetailsAsync instead Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
- ExternalPurchaseLinkResultIOS
- Result of presenting an external purchase link (iOS 18.2+)
- ExternalPurchaseNoticeResultIOS
- Result of presenting external purchase notice sheet (iOS 18.2+)
- FetchProductsResult
- FetchProductsResultAll
- FetchProductsResultProducts
- FetchProductsResultSubscriptions
- FlutterInappPurchase
- InitConnectionConfig
- Connection initialization configuration
- LaunchExternalLinkParamsAndroid
- Parameters for launching an external link (Android) Used with launchExternalLink to initiate external offer or app install flows Available in Google Play Billing Library 8.2.0+
- LimitedQuantityInfoAndroid
- Limited quantity information for one-time purchase offers (Android) Available in Google Play Billing Library 7.0+
- MutationHandlers
- MutationResolver
- GraphQL root mutation operations.
- PreorderDetailsAndroid
- Pre-order details for one-time purchase products (Android) Available in Google Play Billing Library 8.1.0+
- PricingPhaseAndroid
- PricingPhasesAndroid
- Product
- ProductAndroid
- ProductAndroidOneTimePurchaseOfferDetail
- One-time purchase offer details (Android). Available in Google Play Billing Library 7.0+ @deprecated Use the standardized DiscountOffer type instead for cross-platform compatibility. @see https://openiap.dev/docs/types#discount-offer
- ProductCommon
- ProductIOS
- ProductOrSubscription
- ProductOrSubscriptionProduct
- ProductOrSubscriptionProductSubscription
- ProductRequest
- ProductSubscription
- ProductSubscriptionAndroid
- ProductSubscriptionAndroidOfferDetails
- Subscription offer details (Android). @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. @see https://openiap.dev/docs/types#subscription-offer
- ProductSubscriptionIOS
- Purchase
- PurchaseAndroid
- PurchaseCommon
- PurchaseIOS
- PurchaseOfferIOS
- PurchaseOptions
- PurchaseResult
- Purchase result (legacy - kept for backward compatibility)
- QueryHandlers
- QueryResolver
- GraphQL root query operations.
- RefundResultIOS
- RenewalInfoIOS
- Subscription renewal information from Product.SubscriptionInfo.RenewalInfo https://developer.apple.com/documentation/storekit/product/subscriptioninfo/renewalinfo
- RentalDetailsAndroid
- Rental details for one-time purchase products that can be rented (Android) Available in Google Play Billing Library 7.0+
- RequestPurchaseAndroidBuilder
- Builder for Android purchase props
- RequestPurchaseAndroidProps
- RequestPurchaseBuilder
- Unified purchase parameter builder
- RequestPurchaseIosBuilder
- Builder for iOS-specific purchase props
- RequestPurchaseIosProps
- RequestPurchaseProps
- RequestPurchasePropsByPlatforms
- Platform-specific purchase request parameters.
- RequestPurchaseResult
- RequestPurchaseResultPurchase
- RequestPurchaseResultPurchases
- RequestSubscriptionAndroidBuilder
- Builder for Android subscription props
- RequestSubscriptionAndroidProps
- RequestSubscriptionBuilder
- RequestSubscriptionIosBuilder
- Builder for iOS-specific subscription props
- RequestSubscriptionIosProps
- RequestSubscriptionPropsByPlatforms
- Platform-specific subscription request parameters.
- RequestVerifyPurchaseWithIapkitAppleProps
- RequestVerifyPurchaseWithIapkitGoogleProps
- RequestVerifyPurchaseWithIapkitProps
- Platform-specific verification parameters for IAPKit.
- RequestVerifyPurchaseWithIapkitResult
- SubscriptionHandlers
- SubscriptionInfoIOS
- SubscriptionOffer
- Standardized subscription discount/promotional offer. Provides a unified interface for subscription offers across iOS and Android.
- SubscriptionOfferIOS
- iOS subscription offer details. @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. @see https://openiap.dev/docs/types#subscription-offer
- SubscriptionPeriod
- Subscription period value combining unit and count.
- SubscriptionPeriodValueIOS
- SubscriptionProductReplacementParamsAndroid
- Product-level subscription replacement parameters (Android) Used with setSubscriptionProductReplacementParams in BillingFlowParams.ProductDetailsParams Available in Google Play Billing Library 8.1.0+
- SubscriptionResolver
- GraphQL root subscription operations.
- SubscriptionStatusIOS
- UserChoiceBillingDetails
- User Choice Billing event details (Android) Fired when a user selects alternative billing in the User Choice Billing dialog
- ValidTimeWindowAndroid
- Valid time window for when an offer is available (Android) Available in Google Play Billing Library 7.0+
- VerifyPurchaseAppleOptions
- Apple App Store verification parameters. Used for server-side receipt validation via App Store Server API.
- VerifyPurchaseGoogleOptions
- Google Play Store verification parameters. Used for server-side receipt validation via Google Play Developer API.
- VerifyPurchaseHorizonOptions
- Meta Horizon (Quest) verification parameters. Used for server-side entitlement verification via Meta's S2S API. POST https://graph.oculus.com/$APP_ID/verify_entitlement
- VerifyPurchaseProps
- Platform-specific purchase verification parameters.
- VerifyPurchaseResult
- VerifyPurchaseResultAndroid
- VerifyPurchaseResultHorizon
- Result from Meta Horizon verify_entitlement API. Returns verification status and grant time for the entitlement.
- VerifyPurchaseResultIOS
- VerifyPurchaseWithProviderError
- VerifyPurchaseWithProviderProps
- VerifyPurchaseWithProviderResult
Enums
- AlternativeBillingModeAndroid
- Alternative billing mode for Android Controls which billing system is used @deprecated Use enableBillingProgramAndroid with BillingProgramAndroid instead. Use USER_CHOICE_BILLING for user choice billing, EXTERNAL_OFFER for alternative only.
- AndroidPurchaseState
- Android purchase states from Google Play Billing
- AndroidReplacementMode
- Android Replacement Mode (formerly Proration Mode)
- BillingClientState
- Billing client state
- BillingProgramAndroid
- Billing program types for external content links, external offers, and external payments (Android) Available in Google Play Billing Library 8.2.0+, EXTERNAL_PAYMENTS added in 8.3.0
- DeveloperBillingLaunchModeAndroid
- Launch mode for developer billing option (Android) Determines how the external payment URL is launched Available in Google Play Billing Library 8.3.0+
- DiscountOfferType
- Discount offer type enumeration. Categorizes the type of discount or promotional offer.
- ErrorCode
- ExternalLinkLaunchModeAndroid
- Launch mode for external link flow (Android) Determines how the external URL is launched Available in Google Play Billing Library 8.2.0+
- ExternalLinkTypeAndroid
- Link type for external link flow (Android) Specifies the type of external link destination Available in Google Play Billing Library 8.2.0+
- ExternalPurchaseNoticeAction
- User actions on external purchase notice sheet (iOS 18.2+)
- IapEvent
- IapkitPurchaseState
- Unified purchase states from IAPKit verification response.
- IapPlatform
- IapStore
- InAppMessageType
- In-app message types
- OfferType
- Offer types
- PaymentMode
- Payment mode for subscription offers. Determines how the user pays during the offer period.
- PaymentModeIOS
- ProductAvailability
- Platform availability types
- ProductQueryType
- ProductType
- ProductTypeIOS
- PurchaseState
- PurchaseVerificationProvider
- RefundType
- Refund types
- ReplacementMode
- Replacement mode (Android)
- ReplaceMode
- Replace mode (Android)
- ResponseCodeAndroid
- Android billing response codes
- Store
- Store types
- SubscriptionOfferTypeIOS
- SubscriptionPeriodIOS
- SubscriptionPeriodUnit
- Subscription period unit for cross-platform use.
- SubscriptionReplacementModeAndroid
- Replacement mode for subscription changes (Android) These modes determine how the subscription replacement affects billing. Available in Google Play Billing Library 8.1.0+
- SubscriptionState
- Subscription states
- TransactionState
- Transaction states
- TypeInApp
- A enumeration of in-app purchase types for Android
Mixins
Extensions
Functions
-
androidPurchaseStateFromValue(
int value) → AndroidPurchaseState -
buildIosPurchasePayload(
String nativeType, Object? iosProps) → Map< String, dynamic> ? - Build iOS purchase payload from props
-
convertToPurchase(
Map< String, dynamic> itemJson, {required bool platformIsAndroid, required bool platformIsIOS, required Map<String, bool> acknowledgedAndroidPurchaseTokens, Map<String, dynamic> ? originalJson}) → Purchase -
convertToPurchaseError(
PurchaseResult result, {required IapPlatform platform}) → PurchaseError -
extractPurchases(
dynamic result, {required bool platformIsAndroid, required bool platformIsIOS, required Map< String, bool> acknowledgedAndroidPurchaseTokens}) → List<Purchase> -
extractResult(
dynamic result) → List< PurchaseResult> ? -
getCurrentPlatform(
) → IapPlatform - Get current platform
-
getUserFriendlyErrorMessage(
dynamic error) → String - Returns a user-friendly message for the given error or error code
-
normalizeDynamicMap(
dynamic value) → Map< String, dynamic> ? -
normalizeDynamicValue(
dynamic value) → dynamic -
parseAndLogAndroidResponse(
dynamic result, {required String successLog, required String failureLog}) → void - Parse Android JSON response and log the result
-
parseProductFromNative(
Map< String, dynamic> json, String type, {required bool fallbackIsIOS}) → ProductCommon -
resolveProductType(
Object type) → String
Typedefs
- AndroidPurchaseBuilder = void Function(RequestPurchaseAndroidBuilder builder)
- AndroidSubscriptionBuilder = void Function(RequestSubscriptionAndroidBuilder builder)
- IosPurchaseBuilder = void Function(RequestPurchaseIosBuilder builder)
- IosSubscriptionBuilder = void Function(RequestSubscriptionIosBuilder builder)
-
MutationAcknowledgePurchaseAndroidHandler
= Future<
bool> Function(String purchaseToken) -
MutationBeginRefundRequestIOSHandler
= Future<
String?> Function(String sku) -
MutationCheckAlternativeBillingAvailabilityAndroidHandler
= Future<
bool> Function() -
MutationClearTransactionIOSHandler
= Future<
bool> Function() -
MutationConsumePurchaseAndroidHandler
= Future<
bool> Function(String purchaseToken) -
MutationCreateAlternativeBillingTokenAndroidHandler
= Future<
String?> Function() -
MutationCreateBillingProgramReportingDetailsAndroidHandler
= Future<
BillingProgramReportingDetailsAndroid> Function(BillingProgramAndroid program) -
MutationDeepLinkToSubscriptionsHandler
= Future<
void> Function({String? packageNameAndroid, String? skuAndroid}) -
MutationEndConnectionHandler
= Future<
bool> Function() -
MutationFinishTransactionHandler
= Future<
void> Function({bool? isConsumable, required PurchaseInput purchase}) -
MutationInitConnectionHandler
= Future<
bool> Function({AlternativeBillingModeAndroid? alternativeBillingModeAndroid, BillingProgramAndroid? enableBillingProgramAndroid}) -
MutationIsBillingProgramAvailableAndroidHandler
= Future<
BillingProgramAvailabilityResultAndroid> Function(BillingProgramAndroid program) -
MutationLaunchExternalLinkAndroidHandler
= Future<
bool> Function({required BillingProgramAndroid billingProgram, required ExternalLinkLaunchModeAndroid launchMode, required ExternalLinkTypeAndroid linkType, required String linkUri}) -
MutationPresentCodeRedemptionSheetIOSHandler
= Future<
bool> Function() -
MutationPresentExternalPurchaseLinkIOSHandler
= Future<
ExternalPurchaseLinkResultIOS> Function(String url) -
MutationPresentExternalPurchaseNoticeSheetIOSHandler
= Future<
ExternalPurchaseNoticeResultIOS> Function() -
MutationRequestPurchaseHandler
= Future<
RequestPurchaseResult?> Function(RequestPurchaseProps params) -
MutationRequestPurchaseOnPromotedProductIOSHandler
= Future<
bool> Function() -
MutationRestorePurchasesHandler
= Future<
void> Function() -
MutationShowAlternativeBillingDialogAndroidHandler
= Future<
bool> Function() -
MutationShowManageSubscriptionsIOSHandler
= Future<
List< Function()PurchaseIOS> > -
MutationSyncIOSHandler
= Future<
bool> Function() -
MutationValidateReceiptHandler
= Future<
VerifyPurchaseResult> Function({VerifyPurchaseAppleOptions? apple, VerifyPurchaseGoogleOptions? google, VerifyPurchaseHorizonOptions? horizon}) -
MutationVerifyPurchaseHandler
= Future<
VerifyPurchaseResult> Function({VerifyPurchaseAppleOptions? apple, VerifyPurchaseGoogleOptions? google, VerifyPurchaseHorizonOptions? horizon}) -
MutationVerifyPurchaseWithProviderHandler
= Future<
VerifyPurchaseWithProviderResult> Function({RequestVerifyPurchaseWithIapkitProps? iapkit, required PurchaseVerificationProvider provider}) - PurchaseError = PurchaseError
- PurchaseInput = Purchase
-
QueryCanPresentExternalPurchaseNoticeIOSHandler
= Future<
bool> Function() -
QueryCurrentEntitlementIOSHandler
= Future<
PurchaseIOS?> Function(String sku) -
QueryFetchProductsHandler
= Future<
FetchProductsResult> Function({required List<String> skus, ProductQueryType? type}) -
QueryGetActiveSubscriptionsHandler
= Future<
List< Function([List<ActiveSubscription> >String> ? subscriptionIds]) -
QueryGetAppTransactionIOSHandler
= Future<
AppTransaction?> Function() -
QueryGetAvailablePurchasesHandler
= Future<
List< Function({bool? alsoPublishToEventListenerIOS, bool? onlyIncludeActiveItemsIOS})Purchase> > -
QueryGetPendingTransactionsIOSHandler
= Future<
List< Function()PurchaseIOS> > -
QueryGetPromotedProductIOSHandler
= Future<
ProductIOS?> Function() -
QueryGetReceiptDataIOSHandler
= Future<
String?> Function() -
QueryGetStorefrontHandler
= Future<
String> Function() -
QueryGetStorefrontIOSHandler
= Future<
String> Function() -
QueryGetTransactionJwsIOSHandler
= Future<
String?> Function(String sku) -
QueryHasActiveSubscriptionsHandler
= Future<
bool> Function([List<String> ? subscriptionIds]) -
QueryIsEligibleForIntroOfferIOSHandler
= Future<
bool> Function(String groupID) -
QueryIsTransactionVerifiedIOSHandler
= Future<
bool> Function(String sku) -
QueryLatestTransactionIOSHandler
= Future<
PurchaseIOS?> Function(String sku) -
QuerySubscriptionStatusIOSHandler
= Future<
List< Function(String sku)SubscriptionStatusIOS> > -
QueryValidateReceiptIOSHandler
= Future<
VerifyPurchaseResultIOS> Function({VerifyPurchaseAppleOptions? apple, VerifyPurchaseGoogleOptions? google, VerifyPurchaseHorizonOptions? horizon}) - RequestBuilder = void Function(RequestPurchaseBuilder builder)
-
SubscriptionDeveloperProvidedBillingAndroidHandler
= Future<
DeveloperProvidedBillingDetailsAndroid> Function() - SubscriptionOfferAndroid = AndroidSubscriptionOfferInput
-
SubscriptionPromotedProductIOSHandler
= Future<
String> Function() -
SubscriptionPurchaseErrorHandler
= Future<
PurchaseError> Function() -
SubscriptionPurchaseUpdatedHandler
= Future<
Purchase> Function() -
SubscriptionUserChoiceBillingAndroidHandler
= Future<
UserChoiceBillingDetails> Function() - VoidResult = void