-
public final class SubscriptionHandlers
-
-
Field Summary
Fields Modifier and Type Field Description private final SuspendFunction0<DeveloperProvidedBillingDetailsAndroid>developerProvidedBillingAndroidprivate final SuspendFunction0<String>promotedProductIOSprivate final SuspendFunction0<PurchaseError>purchaseErrorprivate final SuspendFunction1<PurchaseUpdatedListenerOptions, Purchase>purchaseUpdatedprivate final SuspendFunction0<Purchase>subscriptionBillingIssueprivate final SuspendFunction0<UserChoiceBillingDetails>userChoiceBillingAndroid
-
Constructor Summary
Constructors Constructor Description SubscriptionHandlers(SuspendFunction0<DeveloperProvidedBillingDetailsAndroid> developerProvidedBillingAndroid, SuspendFunction0<String> promotedProductIOS, SuspendFunction0<PurchaseError> purchaseError, SuspendFunction1<PurchaseUpdatedListenerOptions, Purchase> purchaseUpdated, SuspendFunction0<Purchase> subscriptionBillingIssue, SuspendFunction0<UserChoiceBillingDetails> userChoiceBillingAndroid)
-
Method Summary
Modifier and Type Method Description final SuspendFunction0<DeveloperProvidedBillingDetailsAndroid>getDeveloperProvidedBillingAndroid()Fires when a user selects developer billing in an External Payments or Billing Choice flow (Android only). final SuspendFunction0<String>getPromotedProductIOS()Fires when the App Store surfaces a promoted product (iOS only) final SuspendFunction0<PurchaseError>getPurchaseError()Fires when a purchase fails or is cancelled final SuspendFunction1<PurchaseUpdatedListenerOptions, Purchase>getPurchaseUpdated()Fires when a purchase completes successfully or a pending purchase resolves Options can opt iOS listeners into duplicate StoreKit transaction replays for diagnostics; default listeners receive one event per transaction ID during a single connection session. final SuspendFunction0<Purchase>getSubscriptionBillingIssue()Fires when a subscription enters a billing-issue state that needs user action (payment method failed, card expired, etc.). final SuspendFunction0<UserChoiceBillingDetails>getUserChoiceBillingAndroid()Fires when a user selects alternative billing in the User Choice Billing dialog (Android only) Only triggered when the user selects alternative billing instead of Google Play billing -
-
Constructor Detail
-
SubscriptionHandlers
SubscriptionHandlers(SuspendFunction0<DeveloperProvidedBillingDetailsAndroid> developerProvidedBillingAndroid, SuspendFunction0<String> promotedProductIOS, SuspendFunction0<PurchaseError> purchaseError, SuspendFunction1<PurchaseUpdatedListenerOptions, Purchase> purchaseUpdated, SuspendFunction0<Purchase> subscriptionBillingIssue, SuspendFunction0<UserChoiceBillingDetails> userChoiceBillingAndroid)
-
-
Method Detail
-
getDeveloperProvidedBillingAndroid
final SuspendFunction0<DeveloperProvidedBillingDetailsAndroid> getDeveloperProvidedBillingAndroid()
Fires when a user selects developer billing in an External Payments or Billing Choice flow (Android only). The payload can contain an external transaction token, link URI, original transaction ID, and selected products. Billing Choice payload fields are available in OpenIAP Spec 2.1.0 / openiap-google 2.3.0 (requires Play Billing 9.1.0+).
-
getPromotedProductIOS
final SuspendFunction0<String> getPromotedProductIOS()
Fires when the App Store surfaces a promoted product (iOS only)
-
getPurchaseError
final SuspendFunction0<PurchaseError> getPurchaseError()
Fires when a purchase fails or is cancelled
-
getPurchaseUpdated
final SuspendFunction1<PurchaseUpdatedListenerOptions, Purchase> getPurchaseUpdated()
Fires when a purchase completes successfully or a pending purchase resolves Options can opt iOS listeners into duplicate StoreKit transaction replays for diagnostics; default listeners receive one event per transaction ID during a single connection session.
-
getSubscriptionBillingIssue
final SuspendFunction0<Purchase> getSubscriptionBillingIssue()
Fires when a subscription enters a billing-issue state that needs user action (payment method failed, card expired, etc.). Cross-platform unification:
iOS 16.4+ / Mac Catalyst 16.4+ / visionOS 1.0+: delivered via StoreKit 2
Message.Reason.billingIssue.Android (Play flavor, Billing 8.1+): emitted when
isSuspended == trueis first detected on a previously healthy subscription. Requires Google Play Billing Library 8.1.0 or newer.Android (Horizon flavor): NOT emitted. The Horizon Billing Compatibility SDK implements the Play Billing 7.0 API surface which does not expose a suspended-subscription signal.
Android (Amazon flavor): NOT emitted. Amazon Appstore IAP does not expose an equivalent subscription billing-issue signal.
Listeners should not assume the event will fire on every store. Direct users to the platform subscription management UI (
deepLinkToSubscriptions) to resolve the issue.
-
getUserChoiceBillingAndroid
final SuspendFunction0<UserChoiceBillingDetails> getUserChoiceBillingAndroid()
Fires when a user selects alternative billing in the User Choice Billing dialog (Android only) Only triggered when the user selects alternative billing instead of Google Play billing
-
-
-
-