react-native-iap 15.5.4 → 15.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +163 -15
  2. package/android/src/main/java/com/margelo/nitro/iap/PendingEventBuffer.kt +86 -0
  3. package/android/src/main/java/com/margelo/nitro/iap/RnIapLog.kt +13 -0
  4. package/ios/HybridRnIap.swift +31 -4
  5. package/ios/RnIapHelper.swift +3 -2
  6. package/ios/RnIapLog.swift +14 -0
  7. package/lib/module/hooks/useIAP.js +8 -2
  8. package/lib/module/hooks/useIAP.js.map +1 -1
  9. package/lib/module/index.js +105 -30
  10. package/lib/module/index.js.map +1 -1
  11. package/lib/module/index.kepler.js +72 -5
  12. package/lib/module/index.kepler.js.map +1 -1
  13. package/lib/module/kit-api.js +78 -3
  14. package/lib/module/kit-api.js.map +1 -1
  15. package/lib/module/types.js +29 -25
  16. package/lib/module/types.js.map +1 -1
  17. package/lib/module/utils/deprecation.js +15 -0
  18. package/lib/module/utils/deprecation.js.map +1 -0
  19. package/lib/module/utils/platform-request.js +28 -0
  20. package/lib/module/utils/platform-request.js.map +1 -0
  21. package/lib/module/utils/type-bridge.js +9 -4
  22. package/lib/module/utils/type-bridge.js.map +1 -1
  23. package/lib/module/vega-adapter.js +34 -22
  24. package/lib/module/vega-adapter.js.map +1 -1
  25. package/lib/typescript/src/hooks/useIAP.d.ts +16 -2
  26. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  27. package/lib/typescript/src/index.d.ts +56 -12
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/index.kepler.d.ts +50 -4
  30. package/lib/typescript/src/index.kepler.d.ts.map +1 -1
  31. package/lib/typescript/src/kit-api.d.ts +18 -8
  32. package/lib/typescript/src/kit-api.d.ts.map +1 -1
  33. package/lib/typescript/src/specs/RnIap.nitro.d.ts +32 -6
  34. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  35. package/lib/typescript/src/types.d.ts +119 -175
  36. package/lib/typescript/src/types.d.ts.map +1 -1
  37. package/lib/typescript/src/utils/deprecation.d.ts +3 -0
  38. package/lib/typescript/src/utils/deprecation.d.ts.map +1 -0
  39. package/lib/typescript/src/utils/platform-request.d.ts +12 -0
  40. package/lib/typescript/src/utils/platform-request.d.ts.map +1 -0
  41. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  42. package/lib/typescript/src/vega-adapter.d.ts +1 -0
  43. package/lib/typescript/src/vega-adapter.d.ts.map +1 -1
  44. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +16 -0
  45. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -0
  46. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +5 -1
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +4 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +7 -2
  49. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +8 -0
  50. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
  51. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +19 -0
  52. package/nitrogen/generated/ios/swift/NitroPurchase.swift +39 -2
  53. package/nitrogen/generated/shared/c++/HybridRnIapSpec.cpp +1 -0
  54. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +1 -0
  55. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +5 -1
  56. package/openiap-versions.json +3 -3
  57. package/package.json +1 -1
  58. package/src/hooks/useIAP.ts +22 -2
  59. package/src/index.kepler.ts +86 -8
  60. package/src/index.ts +139 -47
  61. package/src/kit-api.ts +136 -13
  62. package/src/specs/RnIap.nitro.ts +33 -6
  63. package/src/types.ts +130 -203
  64. package/src/utils/deprecation.ts +16 -0
  65. package/src/utils/platform-request.ts +37 -0
  66. package/src/utils/type-bridge.ts +20 -4
  67. package/src/vega-adapter.ts +50 -24
  68. package/lib/module/hooks/useWebhookEvents.js +0 -113
  69. package/lib/module/hooks/useWebhookEvents.js.map +0 -1
  70. package/lib/module/webhook-client.js +0 -164
  71. package/lib/module/webhook-client.js.map +0 -1
  72. package/lib/typescript/src/hooks/useWebhookEvents.d.ts +0 -55
  73. package/lib/typescript/src/hooks/useWebhookEvents.d.ts.map +0 -1
  74. package/lib/typescript/src/webhook-client.d.ts +0 -82
  75. package/lib/typescript/src/webhook-client.d.ts.map +0 -1
  76. package/src/hooks/useWebhookEvents.ts +0 -180
  77. package/src/webhook-client.ts +0 -312
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // ============================================================================
2
2
  // AUTO-GENERATED TYPES — DO NOT EDIT DIRECTLY
3
- // Run `npm run generate` after updating any *.graphql schema file.
3
+ // Refresh this file with the generated-types workflow documented for your checkout.
4
4
  // ============================================================================
5
5
 
6
6
  export interface ActiveSubscription {
@@ -30,9 +30,9 @@ export interface ActiveSubscription {
30
30
  transactionDate: number;
31
31
  transactionId: string;
32
32
  /**
33
- * @deprecated iOS only - use daysUntilExpirationIOS instead.
34
33
  * Whether the subscription will expire soon (within 7 days).
35
34
  * Consider using daysUntilExpirationIOS for more precise control.
35
+ * @deprecated iOS only - use daysUntilExpirationIOS instead. Scheduled for removal in OpenIAP 3.0.
36
36
  */
37
37
  willExpireSoon?: (boolean | null);
38
38
  }
@@ -90,8 +90,9 @@ export interface AdvancedCommerceRefundIOS {
90
90
  /**
91
91
  * Alternative billing mode for Android
92
92
  * Controls which billing system is used
93
- * @deprecated Use enableBillingProgramAndroid with BillingProgramAndroid instead.
94
- * Use USER_CHOICE_BILLING for user choice billing, EXTERNAL_OFFER for alternative only.
93
+ * Use the user-choice-billing program for user choice billing and external-offer
94
+ * for external digital-content offers.
95
+ * @deprecated Use enableBillingProgramAndroid with BillingProgramAndroid instead. Scheduled for removal in OpenIAP 3.0.
95
96
  */
96
97
  export type AlternativeBillingModeAndroid = 'none' | 'user-choice' | 'alternative-only';
97
98
 
@@ -327,8 +328,8 @@ export interface DiscountDisplayInfoAndroid {
327
328
 
328
329
  /**
329
330
  * Discount information returned from the store.
330
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
331
- * @see https://openiap.dev/docs/types#subscription-offer
331
+ * @see https://openiap.dev/docs/types/subscription-offer
332
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
332
333
  */
333
334
  export interface DiscountIOS {
334
335
  identifier: string;
@@ -343,12 +344,13 @@ export interface DiscountIOS {
343
344
 
344
345
  /**
345
346
  * Standardized one-time product discount offer.
346
- * Provides a unified interface for one-time purchase discounts across platforms.
347
+ * Provides a platform-neutral OpenIAP shape for Google Play one-time product
348
+ * purchase options and offers.
347
349
  *
348
- * Currently supported on Android (Google Play Billing 8.0+).
349
- * iOS does not support one-time purchase discounts in the same way.
350
+ * Currently populated only on Android (Google Play Billing 8.0+).
351
+ * iOS does not populate this type.
350
352
  *
351
- * @see https://openiap.dev/docs/features/discount
353
+ * @see https://openiap.dev/docs/types/discount-offer
352
354
  */
353
355
  export interface DiscountOffer {
354
356
  /** Currency code (ISO 4217, e.g., "USD") */
@@ -360,7 +362,7 @@ export interface DiscountOffer {
360
362
  discountAmountMicrosAndroid?: (string | null);
361
363
  /** Formatted display price string (e.g., "$4.99") */
362
364
  displayPrice: string;
363
- /** [Android] Formatted discount amount string (e.g., "$5.00 OFF"). */
365
+ /** [Android] Formatted discount amount including its currency sign (e.g., "$5.00"). */
364
366
  formattedDiscountAmountAndroid?: (string | null);
365
367
  /**
366
368
  * [Android] Original full price in micro-units before discount.
@@ -406,7 +408,11 @@ export interface DiscountOffer {
406
408
  purchaseOptionIdAndroid?: (string | null);
407
409
  /** [Android] Rental details if this is a rental offer. */
408
410
  rentalDetailsAndroid?: (RentalDetailsAndroid | null);
409
- /** Type of discount offer */
411
+ /**
412
+ * Offer category. DiscountOffer currently represents Android one-time product
413
+ * offers and is populated as OneTime. Introductory and Promotional are used by
414
+ * SubscriptionOffer.
415
+ */
410
416
  type: DiscountOfferType;
411
417
  /**
412
418
  * [Android] Valid time window for the offer.
@@ -417,8 +423,8 @@ export interface DiscountOffer {
417
423
 
418
424
  /**
419
425
  * iOS DiscountOffer (output type).
420
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
421
- * @see https://openiap.dev/docs/types#subscription-offer
426
+ * @see https://openiap.dev/docs/types/subscription-offer
427
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
422
428
  */
423
429
  export interface DiscountOfferIOS {
424
430
  /** Discount identifier */
@@ -484,8 +490,11 @@ export enum ErrorCode {
484
490
  PurchaseVerificationFinishFailed = 'purchase-verification-finish-failed',
485
491
  PurchaseVerificationFinished = 'purchase-verification-finished',
486
492
  QueryProduct = 'query-product',
493
+ /** @deprecated Use PurchaseVerificationFailed instead. Scheduled for removal in OpenIAP 3.0. */
487
494
  ReceiptFailed = 'receipt-failed',
495
+ /** @deprecated Use PurchaseVerificationFinished instead. Scheduled for removal in OpenIAP 3.0. */
488
496
  ReceiptFinished = 'receipt-finished',
497
+ /** @deprecated Use PurchaseVerificationFinishFailed instead. Scheduled for removal in OpenIAP 3.0. */
489
498
  ReceiptFinishedFailed = 'receipt-finished-failed',
490
499
  RemoteError = 'remote-error',
491
500
  ServiceDisconnected = 'service-disconnected',
@@ -517,8 +526,8 @@ export type ExternalLinkTypeAndroid = 'unspecified' | 'link-to-digital-content-o
517
526
 
518
527
  /**
519
528
  * External offer availability result (Android)
520
- * @deprecated Use BillingProgramAvailabilityResultAndroid with isBillingProgramAvailableAsync instead
521
529
  * Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
530
+ * @deprecated Use BillingProgramAvailabilityResultAndroid from isBillingProgramAvailableAndroid instead. Scheduled for removal in OpenIAP 3.0.
522
531
  */
523
532
  export interface ExternalOfferAvailabilityResultAndroid {
524
533
  /** Whether external offers are available for the user */
@@ -527,8 +536,8 @@ export interface ExternalOfferAvailabilityResultAndroid {
527
536
 
528
537
  /**
529
538
  * External offer reporting details (Android)
530
- * @deprecated Use BillingProgramReportingDetailsAndroid with createBillingProgramReportingDetailsAsync instead
531
539
  * Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
540
+ * @deprecated Use BillingProgramReportingDetailsAndroid from createBillingProgramReportingDetailsAndroid instead. Scheduled for removal in OpenIAP 3.0.
532
541
  */
533
542
  export interface ExternalOfferReportingDetailsAndroid {
534
543
  /** External transaction token for reporting external offer transactions */
@@ -675,8 +684,8 @@ export interface InitConnectionConfig {
675
684
  /**
676
685
  * Alternative billing mode for Android
677
686
  * If not specified, defaults to NONE (standard Google Play billing)
678
- * @deprecated Use enableBillingProgramAndroid instead.
679
687
  * Use USER_CHOICE_BILLING for user choice billing, EXTERNAL_OFFER for alternative only.
688
+ * @deprecated Use enableBillingProgramAndroid instead. Scheduled for removal in OpenIAP 3.0.
680
689
  */
681
690
  alternativeBillingModeAndroid?: (AlternativeBillingModeAndroid | null);
682
691
  /**
@@ -773,6 +782,7 @@ export interface Mutation {
773
782
  * Returns true if available, false otherwise.
774
783
  * Throws OpenIapError.NotPrepared if billing client not ready.
775
784
  * See: https://openiap.dev/docs/apis/android/check-alternative-billing-availability-android
785
+ * @deprecated Use isBillingProgramAvailableAndroid with the external-offer BillingProgramAndroid value instead. Scheduled for removal in OpenIAP 3.0.
776
786
  */
777
787
  checkAlternativeBillingAvailabilityAndroid: Promise<boolean>;
778
788
  /**
@@ -792,6 +802,7 @@ export interface Mutation {
792
802
  * Returns token string, or null if creation failed.
793
803
  * Throws OpenIapError.NotPrepared if billing client not ready.
794
804
  * See: https://openiap.dev/docs/apis/android/create-alternative-billing-token-android
805
+ * @deprecated Use createBillingProgramReportingDetailsAndroid with the external-offer BillingProgramAndroid value instead. Scheduled for removal in OpenIAP 3.0.
795
806
  */
796
807
  createAlternativeBillingTokenAndroid?: Promise<(string | null)>;
797
808
  /**
@@ -852,6 +863,20 @@ export interface Mutation {
852
863
  * See: https://openiap.dev/docs/apis/android/launch-external-link-android
853
864
  */
854
865
  launchExternalLinkAndroid: Promise<boolean>;
866
+ /**
867
+ * Open the Google Play offer/promo code redemption flow so the user can enter a code.
868
+ * On Google Play builds, launches the Play Store redeem page
869
+ * (https://play.google.com/redeem). A purchase listener can receive the redeemed
870
+ * purchase while the app is running with an active billing connection; always
871
+ * reconcile with getAvailablePurchases when the app resumes.
872
+ * Does not require the billing client to be initialized (no Play Billing version requirement).
873
+ * Available in OpenIAP Spec 2.4.2 / openiap-google 2.5.0.
874
+ * Android counterpart of presentCodeRedemptionSheetIOS.
875
+ * Returns true when the redemption flow was launched, or false when the current
876
+ * store flavor does not provide an equivalent redemption flow.
877
+ * See: https://openiap.dev/docs/apis/android/open-redeem-offer-code-android
878
+ */
879
+ openRedeemOfferCodeAndroid: Promise<boolean>;
855
880
  /**
856
881
  * Show the App Store offer code redemption sheet.
857
882
  * See: https://openiap.dev/docs/apis/ios/present-code-redemption-sheet-ios
@@ -877,11 +902,8 @@ export interface Mutation {
877
902
  /**
878
903
  * Buy the currently promoted product.
879
904
  *
880
- * @deprecated Use promotedProductListenerIOS to receive the productId,
881
- * then call requestPurchase with that SKU instead. In StoreKit 2,
882
- * promoted products can be purchased directly via the standard purchase flow.
883
905
  * See: https://openiap.dev/docs/apis/ios/request-purchase-on-promoted-product-ios
884
- * @deprecated Use promotedProductListenerIOS + requestPurchase instead
906
+ * @deprecated Use the promoted-product listener or callback exposed by your SDK to receive the productId, then call requestPurchase with that SKU instead. In StoreKit 2, promoted products can be purchased directly via the standard purchase flow. Scheduled for removal in OpenIAP 3.0.
885
907
  */
886
908
  requestPurchaseOnPromotedProductIOS: Promise<boolean>;
887
909
  /**
@@ -895,6 +917,7 @@ export interface Mutation {
895
917
  * Returns true if user accepted, false if user canceled.
896
918
  * Throws OpenIapError.NotPrepared if billing client not ready.
897
919
  * See: https://openiap.dev/docs/apis/android/show-alternative-billing-dialog-android
920
+ * @deprecated Use launchExternalLinkAndroid instead. Scheduled for removal in OpenIAP 3.0.
898
921
  */
899
922
  showAlternativeBillingDialogAndroid: Promise<boolean>;
900
923
  /**
@@ -934,7 +957,7 @@ export interface Mutation {
934
957
  /**
935
958
  * Deprecated. Validate purchase receipts with the configured providers — use verifyPurchase instead.
936
959
  * See: https://openiap.dev/docs/features/validation#verify-purchase
937
- * @deprecated Use verifyPurchase
960
+ * @deprecated Use verifyPurchase. Scheduled for removal in OpenIAP 3.0.
938
961
  */
939
962
  validateReceipt: Promise<VerifyPurchaseResult>;
940
963
  /**
@@ -955,8 +978,6 @@ export interface Mutation {
955
978
  verifyPurchaseWithProvider: Promise<VerifyPurchaseWithProviderResult>;
956
979
  }
957
980
 
958
-
959
-
960
981
  export type MutationAcknowledgePurchaseAndroidArgs = string;
961
982
 
962
983
  export type MutationBeginRefundRequestIosArgs = string;
@@ -968,7 +989,6 @@ export interface MutationCreateBillingProgramReportingDetailsAndroidArgs {
968
989
  program: BillingProgramAndroid;
969
990
  }
970
991
 
971
-
972
992
  export type MutationDeepLinkToSubscriptionsArgs = (DeepLinkOptions | null) | undefined;
973
993
 
974
994
  export interface MutationFinishTransactionArgs {
@@ -976,7 +996,6 @@ export interface MutationFinishTransactionArgs {
976
996
  purchase: PurchaseInput;
977
997
  }
978
998
 
979
-
980
999
  export type MutationInitConnectionArgs = (InitConnectionConfig | null) | undefined;
981
1000
 
982
1001
  export type MutationIsBillingProgramAvailableAndroidArgs = BillingProgramAndroid;
@@ -985,22 +1004,7 @@ export type MutationLaunchExternalLinkAndroidArgs = LaunchExternalLinkParamsAndr
985
1004
 
986
1005
  export type MutationPresentExternalPurchaseLinkIosArgs = string;
987
1006
 
988
- export type MutationRequestPurchaseArgs =
989
- | {
990
- /** Per-platform purchase request props */
991
- request: RequestPurchasePropsByPlatforms;
992
- type: 'in-app';
993
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
994
- useAlternativeBilling?: boolean | null;
995
- }
996
- | {
997
- /** Per-platform subscription request props */
998
- request: RequestSubscriptionPropsByPlatforms;
999
- type: 'subs';
1000
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1001
- useAlternativeBilling?: boolean | null;
1002
- };
1003
-
1007
+ export type MutationRequestPurchaseArgs = RequestPurchaseProps;
1004
1008
 
1005
1009
  export type MutationShowBillingProgramInformationDialogAndroidArgs = BillingProgramInformationDialogParamsAndroid;
1006
1010
 
@@ -1079,9 +1083,9 @@ export interface ProductAndroid extends ProductCommon {
1079
1083
  debugDescription?: (string | null);
1080
1084
  description: string;
1081
1085
  /**
1082
- * Standardized discount offers for one-time products.
1083
- * Cross-platform type with Android-specific fields using suffix.
1084
- * @see https://openiap.dev/docs/types#discount-offer
1086
+ * Standardized Android one-time product purchase options and offers.
1087
+ * Native metadata uses Android-suffixed fields.
1088
+ * @see https://openiap.dev/docs/types/discount-offer
1085
1089
  */
1086
1090
  discountOffers?: (DiscountOffer[] | null);
1087
1091
  displayName?: (string | null);
@@ -1091,8 +1095,7 @@ export interface ProductAndroid extends ProductCommon {
1091
1095
  /**
1092
1096
  * One-time purchase offer details including discounts (Android)
1093
1097
  * Returns all eligible offers. Available in Google Play Billing Library 8.0+
1094
- * @deprecated Use discountOffers instead for cross-platform compatibility.
1095
- * @deprecated Use discountOffers instead
1098
+ * @deprecated Use the standardized discountOffers field instead. Scheduled for removal in OpenIAP 3.0.
1096
1099
  */
1097
1100
  oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
1098
1101
  platform: 'android';
@@ -1105,15 +1108,12 @@ export interface ProductAndroid extends ProductCommon {
1105
1108
  * Available in Google Play Billing Library 8.0.0+
1106
1109
  */
1107
1110
  productStatusAndroid?: (ProductStatusAndroid | null);
1108
- /**
1109
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1110
- * @deprecated Use subscriptionOffers instead
1111
- */
1111
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1112
1112
  subscriptionOfferDetailsAndroid?: (ProductSubscriptionAndroidOfferDetails[] | null);
1113
1113
  /**
1114
1114
  * Standardized subscription offers.
1115
1115
  * Cross-platform type with Android-specific fields using suffix.
1116
- * @see https://openiap.dev/docs/types#subscription-offer
1116
+ * @see https://openiap.dev/docs/types/subscription-offer
1117
1117
  */
1118
1118
  subscriptionOffers?: (SubscriptionOffer[] | null);
1119
1119
  title: string;
@@ -1123,8 +1123,8 @@ export interface ProductAndroid extends ProductCommon {
1123
1123
  /**
1124
1124
  * One-time purchase offer details (Android).
1125
1125
  * Available in Google Play Billing Library 8.0+
1126
- * @deprecated Use the standardized DiscountOffer type instead for cross-platform compatibility.
1127
- * @see https://openiap.dev/docs/types#discount-offer
1126
+ * @see https://openiap.dev/docs/types/discount-offer
1127
+ * @deprecated Use the standardized DiscountOffer type for Android one-time offers. Scheduled for removal in OpenIAP 3.0.
1128
1128
  */
1129
1129
  export interface ProductAndroidOneTimePurchaseOfferDetail {
1130
1130
  /**
@@ -1195,16 +1195,13 @@ export interface ProductIOS extends ProductCommon {
1195
1195
  * monthly subscriptions with a 12-month commitment.
1196
1196
  */
1197
1197
  pricingTermsIOS?: (SubscriptionPricingTermsIOS[] | null);
1198
- /**
1199
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1200
- * @deprecated Use subscriptionOffers instead
1201
- */
1198
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1202
1199
  subscriptionInfoIOS?: (SubscriptionInfoIOS | null);
1203
1200
  /**
1204
1201
  * Standardized subscription offers.
1205
1202
  * Cross-platform type with iOS-specific fields using suffix.
1206
1203
  * Note: iOS does not support one-time product discounts.
1207
- * @see https://openiap.dev/docs/types#subscription-offer
1204
+ * @see https://openiap.dev/docs/types/subscription-offer
1208
1205
  */
1209
1206
  subscriptionOffers?: (SubscriptionOffer[] | null);
1210
1207
  title: string;
@@ -1236,9 +1233,8 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1236
1233
  debugDescription?: (string | null);
1237
1234
  description: string;
1238
1235
  /**
1239
- * Standardized discount offers for one-time products.
1240
- * Cross-platform type with Android-specific fields using suffix.
1241
- * @see https://openiap.dev/docs/types#discount-offer
1236
+ * Nullable compatibility field. Google Play does not return one-time purchase
1237
+ * offer details for subscription products; use subscriptionOffers below.
1242
1238
  */
1243
1239
  discountOffers?: (DiscountOffer[] | null);
1244
1240
  displayName?: (string | null);
@@ -1246,10 +1242,9 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1246
1242
  id: string;
1247
1243
  nameAndroid: string;
1248
1244
  /**
1249
- * One-time purchase offer details including discounts (Android)
1250
- * Returns all eligible offers. Available in Google Play Billing Library 8.0+
1251
- * @deprecated Use discountOffers instead for cross-platform compatibility.
1252
- * @deprecated Use discountOffers instead
1245
+ * Legacy nullable compatibility field. Google Play does not populate one-time
1246
+ * purchase offer details for subscription products.
1247
+ * @deprecated One-time offers belong to ProductAndroid.discountOffers; subscriptions use subscriptionOffers. Scheduled for removal in OpenIAP 3.0.
1253
1248
  */
1254
1249
  oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
1255
1250
  platform: 'android';
@@ -1262,15 +1257,12 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1262
1257
  * Available in Google Play Billing Library 8.0.0+
1263
1258
  */
1264
1259
  productStatusAndroid?: (ProductStatusAndroid | null);
1265
- /**
1266
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1267
- * @deprecated Use subscriptionOffers instead
1268
- */
1260
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1269
1261
  subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];
1270
1262
  /**
1271
1263
  * Standardized subscription offers.
1272
1264
  * Cross-platform type with Android-specific fields using suffix.
1273
- * @see https://openiap.dev/docs/types#subscription-offer
1265
+ * @see https://openiap.dev/docs/types/subscription-offer
1274
1266
  */
1275
1267
  subscriptionOffers: SubscriptionOffer[];
1276
1268
  title: string;
@@ -1279,8 +1271,8 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1279
1271
 
1280
1272
  /**
1281
1273
  * Subscription offer details (Android).
1282
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
1283
- * @see https://openiap.dev/docs/types#subscription-offer
1274
+ * @see https://openiap.dev/docs/types/subscription-offer
1275
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
1284
1276
  */
1285
1277
  export interface ProductSubscriptionAndroidOfferDetails {
1286
1278
  basePlanId: string;
@@ -1300,10 +1292,7 @@ export interface ProductSubscriptionIOS extends ProductCommon {
1300
1292
  currency: string;
1301
1293
  debugDescription?: (string | null);
1302
1294
  description: string;
1303
- /**
1304
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1305
- * @deprecated Use subscriptionOffers instead
1306
- */
1295
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1307
1296
  discountsIOS?: (DiscountIOS[] | null);
1308
1297
  displayName?: (string | null);
1309
1298
  displayNameIOS: string;
@@ -1325,15 +1314,12 @@ export interface ProductSubscriptionIOS extends ProductCommon {
1325
1314
  pricingTermsIOS?: (SubscriptionPricingTermsIOS[] | null);
1326
1315
  /** App Store subscription group identifier for intro-offer eligibility checks. */
1327
1316
  subscriptionGroupIdIOS?: (string | null);
1328
- /**
1329
- * @deprecated Use subscriptionOffers for offer metadata and subscriptionGroupIdIOS for the App Store subscription group identifier.
1330
- * @deprecated Use subscriptionOffers for offers and subscriptionGroupIdIOS for group ID
1331
- */
1317
+ /** @deprecated Use subscriptionOffers for offer metadata and subscriptionGroupIdIOS for the App Store subscription group identifier. Scheduled for removal in OpenIAP 3.0. */
1332
1318
  subscriptionInfoIOS?: (SubscriptionInfoIOS | null);
1333
1319
  /**
1334
1320
  * Standardized subscription offers.
1335
1321
  * Cross-platform type with iOS-specific fields using suffix.
1336
- * @see https://openiap.dev/docs/types#subscription-offer
1322
+ * @see https://openiap.dev/docs/types/subscription-offer
1337
1323
  */
1338
1324
  subscriptionOffers?: (SubscriptionOffer[] | null);
1339
1325
  subscriptionPeriodNumberIOS?: (string | null);
@@ -1393,7 +1379,7 @@ export interface PurchaseAndroid extends PurchaseCommon {
1393
1379
  * Available in Google Play Billing Library 5.0+
1394
1380
  */
1395
1381
  pendingPurchaseUpdateAndroid?: (PendingPurchaseUpdateAndroid | null);
1396
- /** @deprecated Use store instead */
1382
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1397
1383
  platform: IapPlatform;
1398
1384
  productId: string;
1399
1385
  purchaseState: PurchaseState;
@@ -1418,7 +1404,7 @@ export interface PurchaseCommon {
1418
1404
  id: string;
1419
1405
  ids?: (string[] | null);
1420
1406
  isAutoRenewing: boolean;
1421
- /** @deprecated Use store instead */
1407
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1422
1408
  platform: IapPlatform;
1423
1409
  productId: string;
1424
1410
  purchaseState: PurchaseState;
@@ -1470,7 +1456,7 @@ export interface PurchaseIOS extends PurchaseCommon {
1470
1456
  originalTransactionDateIOS?: (number | null);
1471
1457
  originalTransactionIdentifierIOS?: (string | null);
1472
1458
  ownershipTypeIOS?: (string | null);
1473
- /** @deprecated Use store instead */
1459
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1474
1460
  platform: IapPlatform;
1475
1461
  productId: string;
1476
1462
  purchaseState: PurchaseState;
@@ -1608,7 +1594,7 @@ export interface Query {
1608
1594
  * Deprecated. Get the current App Store storefront ISO 3166-1 alpha-3 country
1609
1595
  * code — use cross-platform getStorefront instead.
1610
1596
  * See: https://openiap.dev/docs/apis/ios/get-storefront-ios
1611
- * @deprecated Use getStorefront
1597
+ * @deprecated Use getStorefront. Scheduled for removal in OpenIAP 3.0.
1612
1598
  */
1613
1599
  getStorefrontIOS: Promise<string>;
1614
1600
  /**
@@ -1651,13 +1637,11 @@ export interface Query {
1651
1637
  /**
1652
1638
  * Deprecated. Legacy App Store receipt validation — use verifyPurchase instead.
1653
1639
  * See: https://openiap.dev/docs/apis/ios/validate-receipt-ios
1654
- * @deprecated Use verifyPurchase
1640
+ * @deprecated Use verifyPurchase. Scheduled for removal in OpenIAP 3.0.
1655
1641
  */
1656
1642
  validateReceiptIOS: Promise<VerifyPurchaseResultIOS>;
1657
1643
  }
1658
1644
 
1659
-
1660
-
1661
1645
  export type QueryCurrentEntitlementIosArgs = string;
1662
1646
 
1663
1647
  export type QueryFetchProductsArgs = ProductRequest;
@@ -1818,15 +1802,23 @@ export type RequestPurchaseProps =
1818
1802
  | {
1819
1803
  /** Per-platform purchase request props */
1820
1804
  request: RequestPurchasePropsByPlatforms;
1805
+ /** Explicit purchase type hint (defaults to in-app) */
1821
1806
  type: 'in-app';
1822
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1807
+ /**
1808
+ * This flag only logs debug info and has no effect on the purchase flow.
1809
+ * @deprecated Use enableBillingProgramAndroid in InitConnectionConfig instead. Scheduled for removal in OpenIAP 3.0.
1810
+ */
1823
1811
  useAlternativeBilling?: boolean | null;
1824
1812
  }
1825
1813
  | {
1826
1814
  /** Per-platform subscription request props */
1827
1815
  request: RequestSubscriptionPropsByPlatforms;
1816
+ /** Explicit purchase type hint (defaults to in-app) */
1828
1817
  type: 'subs';
1829
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1818
+ /**
1819
+ * This flag only logs debug info and has no effect on the purchase flow.
1820
+ * @deprecated Use enableBillingProgramAndroid in InitConnectionConfig instead. Scheduled for removal in OpenIAP 3.0.
1821
+ */
1830
1822
  useAlternativeBilling?: boolean | null;
1831
1823
  };
1832
1824
 
@@ -1840,13 +1832,13 @@ export type RequestPurchaseProps =
1840
1832
  * (determined at build time, not runtime)
1841
1833
  */
1842
1834
  export interface RequestPurchasePropsByPlatforms {
1843
- /** @deprecated Use google instead */
1835
+ /** @deprecated Use google instead. Scheduled for removal in OpenIAP 3.0. */
1844
1836
  android?: (RequestPurchaseAndroidProps | null);
1845
1837
  /** Apple-specific purchase parameters */
1846
1838
  apple?: (RequestPurchaseIosProps | null);
1847
1839
  /** Google-specific purchase parameters */
1848
1840
  google?: (RequestPurchaseAndroidProps | null);
1849
- /** @deprecated Use apple instead */
1841
+ /** @deprecated Use apple instead. Scheduled for removal in OpenIAP 3.0. */
1850
1842
  ios?: (RequestPurchaseIosProps | null);
1851
1843
  }
1852
1844
 
@@ -1878,7 +1870,7 @@ export interface RequestSubscriptionAndroidProps {
1878
1870
  purchaseToken?: (string | null);
1879
1871
  /**
1880
1872
  * Replacement mode for subscription changes
1881
- * @deprecated Use subscriptionProductReplacementParams instead for item-level replacement (8.1.0+)
1873
+ * @deprecated Use subscriptionProductReplacementParams instead for item-level replacement (8.1.0+). Scheduled for removal in OpenIAP 3.0.
1882
1874
  */
1883
1875
  replacementMode?: (number | null);
1884
1876
  /** List of subscription SKUs */
@@ -1949,13 +1941,13 @@ export interface RequestSubscriptionIosProps {
1949
1941
  * (determined at build time, not runtime)
1950
1942
  */
1951
1943
  export interface RequestSubscriptionPropsByPlatforms {
1952
- /** @deprecated Use google instead */
1944
+ /** @deprecated Use google instead. Scheduled for removal in OpenIAP 3.0. */
1953
1945
  android?: (RequestSubscriptionAndroidProps | null);
1954
1946
  /** Apple-specific subscription parameters */
1955
1947
  apple?: (RequestSubscriptionIosProps | null);
1956
1948
  /** Google-specific subscription parameters */
1957
1949
  google?: (RequestSubscriptionAndroidProps | null);
1958
- /** @deprecated Use apple instead */
1950
+ /** @deprecated Use apple instead. Scheduled for removal in OpenIAP 3.0. */
1959
1951
  ios?: (RequestSubscriptionIosProps | null);
1960
1952
  }
1961
1953
 
@@ -2084,8 +2076,6 @@ export interface Subscription {
2084
2076
  userChoiceBillingAndroid: UserChoiceBillingDetails;
2085
2077
  }
2086
2078
 
2087
-
2088
-
2089
2079
  export type SubscriptionPurchaseUpdatedArgs = (PurchaseUpdatedListenerOptions | null) | undefined;
2090
2080
 
2091
2081
  export type SubscriptionBillingPlanTypeIOS = 'unknown' | 'monthly' | 'up-front';
@@ -2112,8 +2102,7 @@ export interface SubscriptionInfoIOS {
2112
2102
  * - iOS: Introductory offers, promotional offers with server-side signatures
2113
2103
  * - Android: Offer tokens with pricing phases
2114
2104
  *
2115
- * @see https://openiap.dev/docs/types/ios#discount-offer
2116
- * @see https://openiap.dev/docs/types/android#subscription-offer
2105
+ * @see https://openiap.dev/docs/types/subscription-offer
2117
2106
  */
2118
2107
  export interface SubscriptionOffer {
2119
2108
  /**
@@ -2187,8 +2176,8 @@ export interface SubscriptionOffer {
2187
2176
 
2188
2177
  /**
2189
2178
  * iOS subscription offer details.
2190
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
2191
- * @see https://openiap.dev/docs/types#subscription-offer
2179
+ * @see https://openiap.dev/docs/types/subscription-offer
2180
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
2192
2181
  */
2193
2182
  export interface SubscriptionOfferIOS {
2194
2183
  displayPrice: string;
@@ -2248,8 +2237,6 @@ export interface SubscriptionProductReplacementParamsAndroid {
2248
2237
  */
2249
2238
  export type SubscriptionReplacementModeAndroid = 'unknown-replacement-mode' | 'with-time-proration' | 'charge-prorated-price' | 'charge-full-price' | 'without-proration' | 'deferred' | 'keep-existing';
2250
2239
 
2251
- export type SubscriptionState = 'active' | 'expired' | 'in-billing-retry' | 'in-grace-period' | 'paused' | 'refunded' | 'revoked' | 'unknown';
2252
-
2253
2240
  export interface SubscriptionStatusIOS {
2254
2241
  renewalInfo?: (RenewalInfoIOS | null);
2255
2242
  state: string;
@@ -2431,67 +2418,6 @@ export interface VerifyPurchaseWithProviderResult {
2431
2418
 
2432
2419
  export type VoidResult = void;
2433
2420
 
2434
- export type WebhookCancellationReason = 'billing-error' | 'other' | 'price-increase-declined' | 'product-unavailable' | 'refunded' | 'user-canceled';
2435
-
2436
- export interface WebhookEvent {
2437
- /** Reason for cancellation, when applicable. */
2438
- cancellationReason?: (WebhookCancellationReason | null);
2439
- /** Localized currency code (ISO 4217) at event time, when available. */
2440
- currency?: (string | null);
2441
- environment: WebhookEventEnvironment;
2442
- /** When the current subscription period ends. Epoch milliseconds. */
2443
- expiresAt?: (number | null);
2444
- /**
2445
- * Stable identifier suitable for idempotency. Derived from the source notification
2446
- * UUID where the store provides one (ASN v2 `notificationUUID`, RTDN message id);
2447
- * otherwise hashed from the canonicalized payload.
2448
- */
2449
- id: string;
2450
- /** Time the underlying event occurred at the store. Epoch milliseconds. */
2451
- occurredAt: number;
2452
- platform: IapPlatform;
2453
- /**
2454
- * Price in micros (1/1,000,000 of the currency unit) at event time, when available.
2455
- * Matches Google Play's `priceAmountMicros` convention; iOS values are converted.
2456
- */
2457
- priceAmountMicros?: (number | null);
2458
- /** Product the event pertains to. May be null for account-level events. */
2459
- productId?: (string | null);
2460
- /** kit project that owns the subscription / purchase this event refers to. */
2461
- projectId: string;
2462
- /**
2463
- * Cross-platform purchase identity used to correlate this event with an existing
2464
- * purchase record. iOS: `originalTransactionId`. Android: `purchaseToken`.
2465
- * Null for `TestNotification` events (Apple ASN v2 / Google RTDN test
2466
- * payloads carry no transaction); always present for every other event type.
2467
- */
2468
- purchaseToken?: (string | null);
2469
- /**
2470
- * Original signed payload from the store. ASN v2 events expose the JWS string;
2471
- * RTDN events expose the base64-decoded Pub/Sub message JSON. Provided so that
2472
- * consumers can independently verify or extract platform-specific fields. kit
2473
- * always validates this payload before emitting the event.
2474
- */
2475
- rawSignedPayload?: (string | null);
2476
- /** Time kit ingested and normalized this event. Epoch milliseconds. */
2477
- receivedAt: number;
2478
- /** When auto-renewal will charge again. Epoch milliseconds. */
2479
- renewsAt?: (number | null);
2480
- source: WebhookEventSource;
2481
- /**
2482
- * Normalized subscription state at the time of event, when the event refers to
2483
- * a subscription. Null for one-time purchase events.
2484
- */
2485
- subscriptionState?: (SubscriptionState | null);
2486
- type: WebhookEventType;
2487
- }
2488
-
2489
- export type WebhookEventEnvironment = 'production' | 'sandbox' | 'xcode';
2490
-
2491
- export type WebhookEventSource = 'apple-app-store-server-notifications-v2' | 'google-play-real-time-developer-notifications' | 'meta-horizon-reconciler';
2492
-
2493
- export type WebhookEventType = 'purchase-consumption-request' | 'purchase-refunded' | 'subscription-canceled' | 'subscription-expired' | 'subscription-in-billing-retry' | 'subscription-in-grace-period' | 'subscription-paused' | 'subscription-price-change' | 'subscription-product-changed' | 'subscription-recovered' | 'subscription-renewed' | 'subscription-resumed' | 'subscription-revoked' | 'subscription-started' | 'subscription-uncanceled' | 'test-notification';
2494
-
2495
2421
  /**
2496
2422
  * Win-back offer input for iOS 18+ (StoreKit 2)
2497
2423
  * Win-back offers are used to re-engage churned subscribers.
@@ -2502,44 +2428,6 @@ export interface WinBackOfferInputIOS {
2502
2428
  /** The win-back offer ID from App Store Connect */
2503
2429
  offerId: string;
2504
2430
  }
2505
- // -- Query helper types (auto-generated)
2506
- export type QueryArgsMap = {
2507
- canPresentExternalPurchaseNoticeIOS: never;
2508
- currentEntitlementIOS: QueryCurrentEntitlementIosArgs;
2509
- fetchProducts: QueryFetchProductsArgs;
2510
- getActiveSubscriptions: QueryGetActiveSubscriptionsArgs;
2511
- getAllTransactionsIOS: never;
2512
- getAppTransactionIOS: never;
2513
- getAvailablePurchases: QueryGetAvailablePurchasesArgs;
2514
- getBillingChoiceInfoAndroid: QueryGetBillingChoiceInfoAndroidArgs;
2515
- getExternalPurchaseCustomLinkTokenIOS: QueryGetExternalPurchaseCustomLinkTokenIosArgs;
2516
- getPendingTransactionsIOS: never;
2517
- getPromotedProductIOS: never;
2518
- getReceiptDataIOS: never;
2519
- getStorefront: never;
2520
- getStorefrontIOS: never;
2521
- getTransactionJwsIOS: QueryGetTransactionJwsIosArgs;
2522
- hasActiveSubscriptions: QueryHasActiveSubscriptionsArgs;
2523
- isEligibleForExternalPurchaseCustomLinkIOS: never;
2524
- isEligibleForIntroOfferIOS: QueryIsEligibleForIntroOfferIosArgs;
2525
- isTransactionVerifiedIOS: QueryIsTransactionVerifiedIosArgs;
2526
- latestTransactionIOS: QueryLatestTransactionIosArgs;
2527
- subscriptionStatusIOS: QuerySubscriptionStatusIosArgs;
2528
- validateReceiptIOS: QueryValidateReceiptIosArgs;
2529
- };
2530
-
2531
- export type QueryField<K extends keyof Query> =
2532
- QueryArgsMap[K] extends never
2533
- ? () => NonNullable<Query[K]>
2534
- : undefined extends QueryArgsMap[K]
2535
- ? (args?: QueryArgsMap[K]) => NonNullable<Query[K]>
2536
- : (args: QueryArgsMap[K]) => NonNullable<Query[K]>;
2537
-
2538
- export type QueryFieldMap = {
2539
- [K in keyof Query]?: QueryField<K>;
2540
- };
2541
- // -- End query helper types
2542
-
2543
2431
  // -- Mutation helper types (auto-generated)
2544
2432
  export type MutationArgsMap = {
2545
2433
  acknowledgePurchaseAndroid: MutationAcknowledgePurchaseAndroidArgs;
@@ -2555,6 +2443,7 @@ export type MutationArgsMap = {
2555
2443
  initConnection: MutationInitConnectionArgs;
2556
2444
  isBillingProgramAvailableAndroid: MutationIsBillingProgramAvailableAndroidArgs;
2557
2445
  launchExternalLinkAndroid: MutationLaunchExternalLinkAndroidArgs;
2446
+ openRedeemOfferCodeAndroid: never;
2558
2447
  presentCodeRedemptionSheetIOS: never;
2559
2448
  presentExternalPurchaseLinkIOS: MutationPresentExternalPurchaseLinkIosArgs;
2560
2449
  presentExternalPurchaseNoticeSheetIOS: never;
@@ -2584,6 +2473,44 @@ export type MutationFieldMap = {
2584
2473
  };
2585
2474
  // -- End mutation helper types
2586
2475
 
2476
+ // -- Query helper types (auto-generated)
2477
+ export type QueryArgsMap = {
2478
+ canPresentExternalPurchaseNoticeIOS: never;
2479
+ currentEntitlementIOS: QueryCurrentEntitlementIosArgs;
2480
+ fetchProducts: QueryFetchProductsArgs;
2481
+ getActiveSubscriptions: QueryGetActiveSubscriptionsArgs;
2482
+ getAllTransactionsIOS: never;
2483
+ getAppTransactionIOS: never;
2484
+ getAvailablePurchases: QueryGetAvailablePurchasesArgs;
2485
+ getBillingChoiceInfoAndroid: QueryGetBillingChoiceInfoAndroidArgs;
2486
+ getExternalPurchaseCustomLinkTokenIOS: QueryGetExternalPurchaseCustomLinkTokenIosArgs;
2487
+ getPendingTransactionsIOS: never;
2488
+ getPromotedProductIOS: never;
2489
+ getReceiptDataIOS: never;
2490
+ getStorefront: never;
2491
+ getStorefrontIOS: never;
2492
+ getTransactionJwsIOS: QueryGetTransactionJwsIosArgs;
2493
+ hasActiveSubscriptions: QueryHasActiveSubscriptionsArgs;
2494
+ isEligibleForExternalPurchaseCustomLinkIOS: never;
2495
+ isEligibleForIntroOfferIOS: QueryIsEligibleForIntroOfferIosArgs;
2496
+ isTransactionVerifiedIOS: QueryIsTransactionVerifiedIosArgs;
2497
+ latestTransactionIOS: QueryLatestTransactionIosArgs;
2498
+ subscriptionStatusIOS: QuerySubscriptionStatusIosArgs;
2499
+ validateReceiptIOS: QueryValidateReceiptIosArgs;
2500
+ };
2501
+
2502
+ export type QueryField<K extends keyof Query> =
2503
+ QueryArgsMap[K] extends never
2504
+ ? () => NonNullable<Query[K]>
2505
+ : undefined extends QueryArgsMap[K]
2506
+ ? (args?: QueryArgsMap[K]) => NonNullable<Query[K]>
2507
+ : (args: QueryArgsMap[K]) => NonNullable<Query[K]>;
2508
+
2509
+ export type QueryFieldMap = {
2510
+ [K in keyof Query]?: QueryField<K>;
2511
+ };
2512
+ // -- End query helper types
2513
+
2587
2514
  // -- Subscription helper types (auto-generated)
2588
2515
  export type SubscriptionArgsMap = {
2589
2516
  developerProvidedBillingAndroid: never;