-
public final class QueryHandlers
-
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description final SuspendFunction0<Boolean>getCanPresentExternalPurchaseNoticeIOS()Check eligibility for the external purchase notice sheet (iOS 17.4+). final SuspendFunction1<String, PurchaseIOS>getCurrentEntitlementIOS()Get the user's current entitlement for a product, using StoreKit 2 (iOS 15+). final SuspendFunction1<ProductRequest, FetchProductsResult>getFetchProducts()Fetch products or subscriptions from the store. final SuspendFunction1<List<String>, List<ActiveSubscription>>getGetActiveSubscriptions()Get details of all currently active subscriptions (filters by subscriptionIds when provided). final SuspendFunction0<List<PurchaseIOS>>getGetAllTransactionsIOS()List every StoreKit transaction (finished + unfinished) for the current user. final SuspendFunction0<AppTransaction>getGetAppTransactionIOS()Fetch the app transaction (iOS 16+). final SuspendFunction1<PurchaseOptions, List<Purchase>>getGetAvailablePurchases()List active purchases for the current user. final SuspendFunction1<GetBillingChoiceInfoParamsAndroid, BillingChoiceInfoAndroid>getGetBillingChoiceInfoAndroid()Fetch Play Billing assets and loyalty text for developer-rendered Billing Choice screens. final SuspendFunction1<ExternalPurchaseCustomLinkTokenTypeIOS, ExternalPurchaseCustomLinkTokenResultIOS>getGetExternalPurchaseCustomLinkTokenIOS()Fetch a token for Apple's External Purchase Server reporting API (iOS 18.1+). final SuspendFunction0<List<PurchaseIOS>>getGetPendingTransactionsIOS()List unfinished StoreKit transactions in the queue. final SuspendFunction0<ProductIOS>getGetPromotedProductIOS()Read the App Store-promoted product, if any (iOS 11+). final SuspendFunction0<String>getGetReceiptDataIOS()Get base64-encoded receipt data (legacy validation). final SuspendFunction0<String>getGetStorefront()Return the store-authoritative country code: ISO 3166-1 alpha-3 on Apple platforms and alpha-2 on Android. final SuspendFunction1<String, String>getGetTransactionJwsIOS()Return the JWS string for a transaction (StoreKit 2). final SuspendFunction1<List<String>, Boolean>getHasActiveSubscriptions()Check whether the user has any active subscription. final SuspendFunction0<Boolean>getIsEligibleForExternalPurchaseCustomLinkIOS()Check eligibility for the custom-link variant of external purchase (iOS 18.1+). final SuspendFunction1<String, Boolean>getIsEligibleForIntroOfferIOS()Check intro-offer eligibility for a subscription group. final SuspendFunction1<String, Boolean>getIsTransactionVerifiedIOS()Check whether a transaction's JWS verification passed (StoreKit 2). final SuspendFunction1<String, PurchaseIOS>getLatestTransactionIOS()Get the latest verified transaction for a product, using StoreKit 2. final SuspendFunction1<String, List<SubscriptionStatusIOS>>getSubscriptionStatusIOS()Get subscription status objects from StoreKit 2 (iOS 15+). -
-
Constructor Detail
-
QueryHandlers
QueryHandlers(SuspendFunction0<Boolean> canPresentExternalPurchaseNoticeIOS, SuspendFunction1<String, PurchaseIOS> currentEntitlementIOS, SuspendFunction1<ProductRequest, FetchProductsResult> fetchProducts, SuspendFunction1<List<String>, List<ActiveSubscription>> getActiveSubscriptions, SuspendFunction0<List<PurchaseIOS>> getAllTransactionsIOS, SuspendFunction0<AppTransaction> getAppTransactionIOS, SuspendFunction1<PurchaseOptions, List<Purchase>> getAvailablePurchases, SuspendFunction1<GetBillingChoiceInfoParamsAndroid, BillingChoiceInfoAndroid> getBillingChoiceInfoAndroid, SuspendFunction1<ExternalPurchaseCustomLinkTokenTypeIOS, ExternalPurchaseCustomLinkTokenResultIOS> getExternalPurchaseCustomLinkTokenIOS, SuspendFunction0<List<PurchaseIOS>> getPendingTransactionsIOS, SuspendFunction0<ProductIOS> getPromotedProductIOS, SuspendFunction0<String> getReceiptDataIOS, SuspendFunction0<String> getStorefront, SuspendFunction1<String, String> getTransactionJwsIOS, SuspendFunction1<List<String>, Boolean> hasActiveSubscriptions, SuspendFunction0<Boolean> isEligibleForExternalPurchaseCustomLinkIOS, SuspendFunction1<String, Boolean> isEligibleForIntroOfferIOS, SuspendFunction1<String, Boolean> isTransactionVerifiedIOS, SuspendFunction1<String, PurchaseIOS> latestTransactionIOS, SuspendFunction1<String, List<SubscriptionStatusIOS>> subscriptionStatusIOS)
-
-
Method Detail
-
getCanPresentExternalPurchaseNoticeIOS
final SuspendFunction0<Boolean> getCanPresentExternalPurchaseNoticeIOS()
Check eligibility for the external purchase notice sheet (iOS 17.4+). Uses ExternalPurchase.canPresent. See: https://openiap.dev/docs/apis/ios/can-present-external-purchase-notice-ios
-
getCurrentEntitlementIOS
final SuspendFunction1<String, PurchaseIOS> getCurrentEntitlementIOS()
Get the user's current entitlement for a product, using StoreKit 2 (iOS 15+). See: https://openiap.dev/docs/apis/ios/current-entitlement-ios
-
getFetchProducts
final SuspendFunction1<ProductRequest, FetchProductsResult> getFetchProducts()
Fetch products or subscriptions from the store. See: https://openiap.dev/docs/apis/fetch-products
-
getGetActiveSubscriptions
final SuspendFunction1<List<String>, List<ActiveSubscription>> getGetActiveSubscriptions()
Get details of all currently active subscriptions (filters by subscriptionIds when provided). See: https://openiap.dev/docs/apis/get-active-subscriptions
-
getGetAllTransactionsIOS
final SuspendFunction0<List<PurchaseIOS>> getGetAllTransactionsIOS()
List every StoreKit transaction (finished + unfinished) for the current user. Requires the SKIncludeConsumableInAppPurchaseHistory Info.plist key in the host app for finished consumables to be included (iOS 18+). Unlike getAvailablePurchases, always returns the iOS-specific PurchaseIOS shape. See: https://openiap.dev/docs/apis/ios/get-all-transactions-ios
-
getGetAppTransactionIOS
final SuspendFunction0<AppTransaction> getGetAppTransactionIOS()
Fetch the app transaction (iOS 16+). See: https://openiap.dev/docs/apis/ios/get-app-transaction-ios
-
getGetAvailablePurchases
final SuspendFunction1<PurchaseOptions, List<Purchase>> getGetAvailablePurchases()
List active purchases for the current user. See: https://openiap.dev/docs/apis/get-available-purchases
-
getGetBillingChoiceInfoAndroid
final SuspendFunction1<GetBillingChoiceInfoParamsAndroid, BillingChoiceInfoAndroid> getGetBillingChoiceInfoAndroid()
Fetch Play Billing assets and loyalty text for developer-rendered Billing Choice screens. OpenIAP availability: Spec 2.1.0 / openiap-google 2.3.0 (requires Play Billing 9.1.0+). Throws OpenIapError.NotPrepared if billing client is not ready. See: https://openiap.dev/docs/apis/android/get-billing-choice-info-android
-
getGetExternalPurchaseCustomLinkTokenIOS
final SuspendFunction1<ExternalPurchaseCustomLinkTokenTypeIOS, ExternalPurchaseCustomLinkTokenResultIOS> getGetExternalPurchaseCustomLinkTokenIOS()
Fetch a token for Apple's External Purchase Server reporting API (iOS 18.1+). Use this token to report transactions made through ExternalPurchaseCustomLink. Reference: https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/token(for:) See: https://openiap.dev/docs/apis/ios/get-external-purchase-custom-link-token-ios Parameter tokenType: Token type: acquisition (new customers) or services (existing customers)
-
getGetPendingTransactionsIOS
final SuspendFunction0<List<PurchaseIOS>> getGetPendingTransactionsIOS()
List unfinished StoreKit transactions in the queue. See: https://openiap.dev/docs/apis/ios/get-pending-transactions-ios
-
getGetPromotedProductIOS
final SuspendFunction0<ProductIOS> getGetPromotedProductIOS()
Read the App Store-promoted product, if any (iOS 11+). See: https://openiap.dev/docs/apis/ios/get-promoted-product-ios
-
getGetReceiptDataIOS
final SuspendFunction0<String> getGetReceiptDataIOS()
Get base64-encoded receipt data (legacy validation). See: https://openiap.dev/docs/apis/ios/get-receipt-data-ios
-
getGetStorefront
final SuspendFunction0<String> getGetStorefront()
Return the store-authoritative country code: ISO 3166-1 alpha-3 on Apple platforms and alpha-2 on Android. The operation fails when the store cannot provide a value; implementations must not synthesize a locale fallback. See: https://openiap.dev/docs/apis/get-storefront
-
getGetTransactionJwsIOS
final SuspendFunction1<String, String> getGetTransactionJwsIOS()
Return the JWS string for a transaction (StoreKit 2). See: https://openiap.dev/docs/apis/ios/get-transaction-jws-ios
-
getHasActiveSubscriptions
final SuspendFunction1<List<String>, Boolean> getHasActiveSubscriptions()
Check whether the user has any active subscription. See: https://openiap.dev/docs/apis/has-active-subscriptions
-
getIsEligibleForExternalPurchaseCustomLinkIOS
final SuspendFunction0<Boolean> getIsEligibleForExternalPurchaseCustomLinkIOS()
Check eligibility for the custom-link variant of external purchase (iOS 18.1+). Returns true if the app can use custom external purchase links. Reference: https://developer.apple.com/documentation/storekit/externalpurchasecustomlink/iseligible See: https://openiap.dev/docs/apis/ios/is-eligible-for-external-purchase-custom-link-ios
-
getIsEligibleForIntroOfferIOS
final SuspendFunction1<String, Boolean> getIsEligibleForIntroOfferIOS()
Check intro-offer eligibility for a subscription group. See: https://openiap.dev/docs/apis/ios/is-eligible-for-intro-offer-ios
-
getIsTransactionVerifiedIOS
final SuspendFunction1<String, Boolean> getIsTransactionVerifiedIOS()
Check whether a transaction's JWS verification passed (StoreKit 2). See: https://openiap.dev/docs/apis/ios/is-transaction-verified-ios
-
getLatestTransactionIOS
final SuspendFunction1<String, PurchaseIOS> getLatestTransactionIOS()
Get the latest verified transaction for a product, using StoreKit 2. See: https://openiap.dev/docs/apis/ios/latest-transaction-ios
-
getSubscriptionStatusIOS
final SuspendFunction1<String, List<SubscriptionStatusIOS>> getSubscriptionStatusIOS()
Get subscription status objects from StoreKit 2 (iOS 15+). See: https://openiap.dev/docs/apis/ios/subscription-status-ios
-
-
-
-