expo-iap 3.0.3 → 3.0.4

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 (59) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/CLAUDE.md +2 -0
  3. package/build/helpers/subscription.d.ts +1 -12
  4. package/build/helpers/subscription.d.ts.map +1 -1
  5. package/build/helpers/subscription.js +12 -7
  6. package/build/helpers/subscription.js.map +1 -1
  7. package/build/index.d.ts +8 -6
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +4 -2
  10. package/build/index.js.map +1 -1
  11. package/build/modules/android.d.ts +7 -6
  12. package/build/modules/android.d.ts.map +1 -1
  13. package/build/modules/android.js +19 -4
  14. package/build/modules/android.js.map +1 -1
  15. package/build/modules/ios.d.ts +7 -10
  16. package/build/modules/ios.d.ts.map +1 -1
  17. package/build/modules/ios.js +3 -1
  18. package/build/modules/ios.js.map +1 -1
  19. package/build/purchase-error.d.ts +69 -0
  20. package/build/purchase-error.d.ts.map +1 -0
  21. package/build/purchase-error.js +164 -0
  22. package/build/purchase-error.js.map +1 -0
  23. package/build/types.d.ts +649 -0
  24. package/build/types.d.ts.map +1 -0
  25. package/build/types.js +100 -0
  26. package/build/types.js.map +1 -0
  27. package/build/useIAP.d.ts +5 -4
  28. package/build/useIAP.d.ts.map +1 -1
  29. package/build/useIAP.js +1 -1
  30. package/build/useIAP.js.map +1 -1
  31. package/build/utils/errorMapping.d.ts +1 -1
  32. package/build/utils/errorMapping.d.ts.map +1 -1
  33. package/build/utils/errorMapping.js +19 -3
  34. package/build/utils/errorMapping.js.map +1 -1
  35. package/jest.config.js +1 -1
  36. package/package.json +1 -1
  37. package/src/helpers/subscription.ts +12 -20
  38. package/src/index.ts +14 -14
  39. package/src/modules/android.ts +28 -10
  40. package/src/modules/ios.ts +11 -13
  41. package/src/purchase-error.ts +268 -0
  42. package/src/types.ts +738 -0
  43. package/src/useIAP.ts +8 -8
  44. package/src/utils/errorMapping.ts +24 -3
  45. package/build/ExpoIap.types.d.ts +0 -307
  46. package/build/ExpoIap.types.d.ts.map +0 -1
  47. package/build/ExpoIap.types.js +0 -235
  48. package/build/ExpoIap.types.js.map +0 -1
  49. package/build/types/ExpoIapAndroid.types.d.ts +0 -114
  50. package/build/types/ExpoIapAndroid.types.d.ts.map +0 -1
  51. package/build/types/ExpoIapAndroid.types.js +0 -29
  52. package/build/types/ExpoIapAndroid.types.js.map +0 -1
  53. package/build/types/ExpoIapIOS.types.d.ts +0 -149
  54. package/build/types/ExpoIapIOS.types.d.ts.map +0 -1
  55. package/build/types/ExpoIapIOS.types.js +0 -8
  56. package/build/types/ExpoIapIOS.types.js.map +0 -1
  57. package/src/ExpoIap.types.ts +0 -444
  58. package/src/types/ExpoIapAndroid.types.ts +0 -133
  59. package/src/types/ExpoIapIOS.types.ts +0 -172
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoIap.types.js","sourceRoot":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAUA,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAQnD,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACrB,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB;AAoDD,8DAA8D;AAC9D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AAczC;;;GAGG;AACH,MAAM,CAAN,IAAY,SAoCX;AApCD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,mDAAsC,CAAA;IACtC,2CAA8B,CAAA;IAC9B,6CAAgC,CAAA;IAChC,6CAAgC,CAAA;IAChC,+CAAkC,CAAA;IAClC,mDAAsC,CAAA;IACtC,gEAAmD,CAA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ProductAndroid,\n PurchaseAndroid,\n ProductSubscriptionAndroid,\n} from './types/ExpoIapAndroid.types';\nimport type {\n ProductIOS,\n PurchaseIOS,\n ProductSubscriptionIOS,\n} from './types/ExpoIapIOS.types';\nimport {NATIVE_ERROR_CODES} from './ExpoIapModule';\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type ProductType = 'inapp' | 'subs';\n\nexport enum PurchaseState {\n Pending = 'pending',\n Purchased = 'purchased',\n Failed = 'failed',\n Restored = 'restored',\n Deferred = 'deferred',\n Unknown = 'unknown',\n}\n\n// =============================================================================\n// COMMON TYPES (Base types shared across all platforms)\n// =============================================================================\n\nexport type ProductCommon = {\n id: string;\n title: string;\n description: string;\n type: ProductType;\n displayName?: string;\n displayPrice: string;\n currency: string;\n price?: number;\n debugDescription?: string;\n platform?: string;\n};\n\nexport type PurchaseCommon = {\n id: string; // Transaction identifier - used by finishTransaction\n productId: string; // Product identifier - which product was purchased\n ids?: string[]; // Product identifiers for purchases that include multiple products\n transactionId?: string; // Legacy identifier\n transactionDate: number;\n purchaseToken?: string; // Unified token (iOS: JWS, Android: purchaseToken)\n platform?: string;\n quantity?: number;\n purchaseState?: PurchaseState;\n isAutoRenewing?: boolean;\n};\n\nexport type ProductSubscriptionCommon = ProductCommon & {\n type: 'subs';\n};\n\n// Define literal platform types for better type discrimination\nexport type IosPlatform = {platform: 'ios'};\nexport type AndroidPlatform = {platform: 'android'};\n\n// Platform-agnostic unified product types (public API)\nexport type Product =\n | (ProductAndroid & AndroidPlatform)\n | (ProductIOS & IosPlatform);\n\nexport type ProductSubscription =\n | (ProductSubscriptionAndroid & AndroidPlatform)\n | (ProductSubscriptionIOS & IosPlatform);\n\n// Legacy naming retained for backward compatibility\nexport type SubscriptionProduct = ProductSubscription;\n\n// Re-export all platform-specific types to avoid deep imports\nexport * from './types/ExpoIapAndroid.types';\nexport * from './types/ExpoIapIOS.types';\n\n// Unified purchase type for both products and subscriptions\nexport type Purchase =\n | (PurchaseAndroid & AndroidPlatform)\n | (PurchaseIOS & IosPlatform);\n\nexport type PurchaseResult = {\n responseCode?: number;\n debugMessage?: string;\n code?: string;\n message?: string;\n purchaseToken?: string;\n};\n/**\n * Centralized error codes for expo-iap\n * These are mapped to platform-specific error codes and provide consistent error handling\n */\nexport enum ErrorCode {\n Unknown = 'E_UNKNOWN',\n UserCancelled = 'E_USER_CANCELLED',\n UserError = 'E_USER_ERROR',\n ItemUnavailable = 'E_ITEM_UNAVAILABLE',\n RemoteError = 'E_REMOTE_ERROR',\n NetworkError = 'E_NETWORK_ERROR',\n ServiceError = 'E_SERVICE_ERROR',\n ReceiptFailed = 'E_RECEIPT_FAILED',\n ReceiptFinished = 'E_RECEIPT_FINISHED',\n ReceiptFinishedFailed = 'E_RECEIPT_FINISHED_FAILED',\n NotPrepared = 'E_NOT_PREPARED',\n NotEnded = 'E_NOT_ENDED',\n AlreadyOwned = 'E_ALREADY_OWNED',\n DeveloperError = 'E_DEVELOPER_ERROR',\n BillingResponseJsonParseError = 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n DeferredPayment = 'E_DEFERRED_PAYMENT',\n Interrupted = 'E_INTERRUPTED',\n IapNotAvailable = 'E_IAP_NOT_AVAILABLE',\n PurchaseError = 'E_PURCHASE_ERROR',\n SyncError = 'E_SYNC_ERROR',\n TransactionValidationFailed = 'E_TRANSACTION_VALIDATION_FAILED',\n ActivityUnavailable = 'E_ACTIVITY_UNAVAILABLE',\n AlreadyPrepared = 'E_ALREADY_PREPARED',\n Pending = 'E_PENDING',\n ConnectionClosed = 'E_CONNECTION_CLOSED',\n // Additional detailed errors (Android-focused, kept cross-platform)\n InitConnection = 'E_INIT_CONNECTION',\n ServiceDisconnected = 'E_SERVICE_DISCONNECTED',\n QueryProduct = 'E_QUERY_PRODUCT',\n SkuNotFound = 'E_SKU_NOT_FOUND',\n SkuOfferMismatch = 'E_SKU_OFFER_MISMATCH',\n ItemNotOwned = 'E_ITEM_NOT_OWNED',\n BillingUnavailable = 'E_BILLING_UNAVAILABLE',\n FeatureNotSupported = 'E_FEATURE_NOT_SUPPORTED',\n EmptySkuList = 'E_EMPTY_SKU_LIST',\n}\n\n// Fast lookup set for validating standardized error code strings\nconst OPENIAP_ERROR_CODE_SET: Set<string> = new Set(\n Object.values(ErrorCode) as string[],\n);\n\n/**\n * Platform-specific error code mappings\n * Maps ErrorCode enum values to platform-specific integer codes\n */\n// Shared OpenIAP string code mapping for both platforms\nconst COMMON_ERROR_CODE_MAP = {\n [ErrorCode.Unknown]: 'E_UNKNOWN',\n [ErrorCode.UserCancelled]: 'E_USER_CANCELLED',\n [ErrorCode.UserError]: 'E_USER_ERROR',\n [ErrorCode.ItemUnavailable]: 'E_ITEM_UNAVAILABLE',\n [ErrorCode.RemoteError]: 'E_REMOTE_ERROR',\n [ErrorCode.NetworkError]: 'E_NETWORK_ERROR',\n [ErrorCode.ServiceError]: 'E_SERVICE_ERROR',\n [ErrorCode.ReceiptFailed]: 'E_RECEIPT_FAILED',\n [ErrorCode.ReceiptFinished]: 'E_RECEIPT_FINISHED',\n [ErrorCode.ReceiptFinishedFailed]: 'E_RECEIPT_FINISHED_FAILED',\n [ErrorCode.NotPrepared]: 'E_NOT_PREPARED',\n [ErrorCode.NotEnded]: 'E_NOT_ENDED',\n [ErrorCode.AlreadyOwned]: 'E_ALREADY_OWNED',\n [ErrorCode.DeveloperError]: 'E_DEVELOPER_ERROR',\n [ErrorCode.BillingResponseJsonParseError]:\n 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n [ErrorCode.DeferredPayment]: 'E_DEFERRED_PAYMENT',\n [ErrorCode.Interrupted]: 'E_INTERRUPTED',\n [ErrorCode.IapNotAvailable]: 'E_IAP_NOT_AVAILABLE',\n [ErrorCode.PurchaseError]: 'E_PURCHASE_ERROR',\n [ErrorCode.SyncError]: 'E_SYNC_ERROR',\n [ErrorCode.TransactionValidationFailed]: 'E_TRANSACTION_VALIDATION_FAILED',\n [ErrorCode.ActivityUnavailable]: 'E_ACTIVITY_UNAVAILABLE',\n [ErrorCode.AlreadyPrepared]: 'E_ALREADY_PREPARED',\n [ErrorCode.Pending]: 'E_PENDING',\n [ErrorCode.ConnectionClosed]: 'E_CONNECTION_CLOSED',\n [ErrorCode.InitConnection]: 'E_INIT_CONNECTION',\n [ErrorCode.ServiceDisconnected]: 'E_SERVICE_DISCONNECTED',\n [ErrorCode.QueryProduct]: 'E_QUERY_PRODUCT',\n [ErrorCode.SkuNotFound]: 'E_SKU_NOT_FOUND',\n [ErrorCode.SkuOfferMismatch]: 'E_SKU_OFFER_MISMATCH',\n [ErrorCode.ItemNotOwned]: 'E_ITEM_NOT_OWNED',\n [ErrorCode.BillingUnavailable]: 'E_BILLING_UNAVAILABLE',\n [ErrorCode.FeatureNotSupported]: 'E_FEATURE_NOT_SUPPORTED',\n [ErrorCode.EmptySkuList]: 'E_EMPTY_SKU_LIST',\n} as const;\n\nexport const ErrorCodeMapping = {\n // iOS: standardized OpenIAP string codes\n ios: COMMON_ERROR_CODE_MAP,\n // Android: standardized OpenIAP string codes\n android: COMMON_ERROR_CODE_MAP,\n} as const;\n\nexport type PurchaseErrorProps = {\n message: string;\n responseCode?: number;\n debugMessage?: string;\n code?: ErrorCode;\n productId?: string;\n platform?: 'ios' | 'android';\n};\n\nexport class PurchaseError implements Error {\n public name: string;\n public message: string;\n public responseCode?: number;\n public debugMessage?: string;\n public code?: ErrorCode;\n public productId?: string;\n public platform?: 'ios' | 'android';\n\n // Backwards-compatible constructor: accepts either props object or legacy positional args\n constructor(messageOrProps: string | PurchaseErrorProps, ...rest: any[]) {\n this.name = '[expo-iap]: PurchaseError';\n\n if (typeof messageOrProps === 'string') {\n // Legacy signature: (name, message, responseCode?, debugMessage?, code?, productId?, platform?)\n // The first legacy argument was a name which we always override, so treat it as message here\n const message = messageOrProps;\n this.message = message;\n this.responseCode = rest[0];\n this.debugMessage = rest[1];\n this.code = rest[2];\n this.productId = rest[3];\n this.platform = rest[4];\n } else {\n const props = messageOrProps;\n this.message = props.message;\n this.responseCode = props.responseCode;\n this.debugMessage = props.debugMessage;\n this.code = props.code;\n this.productId = props.productId;\n this.platform = props.platform;\n }\n }\n\n /**\n * Creates a PurchaseError from platform-specific error data\n * @param errorData Raw error data from native modules\n * @param platform Platform where the error occurred\n * @returns Properly typed PurchaseError instance\n */\n static fromPlatformError(\n errorData: any,\n platform: 'ios' | 'android',\n ): PurchaseError {\n const errorCode = errorData.code\n ? ErrorCodeUtils.fromPlatformCode(errorData.code, platform)\n : ErrorCode.Unknown;\n\n return new PurchaseError({\n message: errorData.message || 'Unknown error occurred',\n responseCode: errorData.responseCode,\n debugMessage: errorData.debugMessage,\n code: errorCode,\n productId: errorData.productId,\n platform,\n });\n }\n\n /**\n * Gets the platform-specific error code for this error\n * @returns Platform-specific error code\n */\n getPlatformCode(): string | number | undefined {\n if (!this.code || !this.platform) return undefined;\n return ErrorCodeUtils.toPlatformCode(this.code, this.platform);\n }\n}\n\n/**\n * Utility functions for error code mapping and validation\n */\nexport const ErrorCodeUtils = {\n /**\n * Gets the native error code for the current platform\n * @param errorCode ErrorCode enum value\n * @returns Platform-specific error code from native constants\n */\n getNativeErrorCode: (errorCode: ErrorCode): string => {\n return NATIVE_ERROR_CODES[errorCode] || errorCode;\n },\n\n /**\n * Maps a platform-specific error code back to the standardized ErrorCode enum\n * @param platformCode Platform-specific error code (string for Android, number for iOS)\n * @param platform Target platform\n * @returns Corresponding ErrorCode enum value or E_UNKNOWN if not found\n */\n fromPlatformCode: (\n platformCode: string | number,\n platform: 'ios' | 'android',\n ): ErrorCode => {\n // If native sent standardized string code, accept it directly\n if (typeof platformCode === 'string' && platformCode.startsWith('E_')) {\n if (OPENIAP_ERROR_CODE_SET.has(platformCode)) {\n return platformCode as ErrorCode;\n }\n }\n // Prefer dynamic native mapping for iOS to avoid drift\n if (platform === 'ios') {\n for (const [, value] of Object.entries(NATIVE_ERROR_CODES || {})) {\n if (value === platformCode) {\n // Native maps friendly keys to standardized 'E_*' codes\n if (typeof value === 'string' && OPENIAP_ERROR_CODE_SET.has(value)) {\n return value as ErrorCode;\n }\n }\n }\n }\n\n const mapping = ErrorCodeMapping[platform];\n for (const [errorCode, mappedCode] of Object.entries(mapping)) {\n if (mappedCode === platformCode) {\n return errorCode as ErrorCode;\n }\n }\n\n return ErrorCode.Unknown;\n },\n\n /**\n * Maps an ErrorCode enum to platform-specific code\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns Platform-specific error code\n */\n toPlatformCode: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): string | number => {\n if (platform === 'ios') {\n const native = (NATIVE_ERROR_CODES as any)?.[errorCode];\n if (native !== undefined) return native;\n }\n const mapping = ErrorCodeMapping[platform] as Record<\n ErrorCode,\n string | number\n >;\n return mapping[errorCode] ?? 'E_UNKNOWN';\n },\n\n /**\n * Checks if an error code is valid for the specified platform\n * @param errorCode ErrorCode enum value\n * @param platform Target platform\n * @returns True if the error code is supported on the platform\n */\n isValidForPlatform: (\n errorCode: ErrorCode,\n platform: 'ios' | 'android',\n ): boolean => {\n return errorCode in ErrorCodeMapping[platform];\n },\n};\n\n// ============================================================================\n// Enhanced Unified Request Types\n// ============================================================================\n\n/**\n * Unified request props that work on both iOS and Android platforms\n * iOS will use 'sku', Android will use 'skus' (or convert sku to skus array)\n */\nexport interface UnifiedRequestPurchaseProps {\n // Universal properties - works on both platforms\n readonly sku?: string; // Single SKU (iOS native, Android fallback)\n readonly skus?: string[]; // Multiple SKUs (Android native, iOS uses first item)\n\n // iOS-specific properties (ignored on Android)\n readonly andDangerouslyFinishTransactionAutomatically?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIOS.types').PaymentDiscount;\n\n // Android-specific properties (ignored on iOS)\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n// ============================================================================\n// New Platform-Specific Request Types (v2.7.0+)\n// ============================================================================\n\n/**\n * iOS-specific purchase request parameters\n */\nexport interface RequestPurchaseIosProps {\n readonly sku: string;\n readonly andDangerouslyFinishTransactionAutomatically?: boolean;\n readonly appAccountToken?: string;\n readonly quantity?: number;\n readonly withOffer?: import('./types/ExpoIapIOS.types').PaymentDiscount;\n}\n\n/**\n * Android-specific purchase request parameters\n */\nexport interface RequestPurchaseAndroidProps {\n readonly skus: string[];\n readonly obfuscatedAccountIdAndroid?: string;\n readonly obfuscatedProfileIdAndroid?: string;\n readonly isOfferPersonalized?: boolean;\n}\n\n/**\n * Android-specific subscription request parameters\n */\nexport interface RequestSubscriptionAndroidProps\n extends RequestPurchaseAndroidProps {\n readonly purchaseTokenAndroid?: string;\n readonly replacementModeAndroid?: number;\n readonly subscriptionOffers: {\n sku: string;\n offerToken: string;\n }[];\n}\n\n/**\n * Modern platform-specific request structure (v2.7.0+)\n * Allows clear separation of iOS and Android parameters\n */\nexport interface RequestPurchasePropsByPlatforms {\n readonly ios?: RequestPurchaseIosProps;\n readonly android?: RequestPurchaseAndroidProps;\n}\n\n/**\n * Modern platform-specific subscription request structure (v2.7.0+)\n */\nexport interface RequestSubscriptionPropsByPlatforms {\n readonly ios?: RequestPurchaseIosProps;\n readonly android?: RequestSubscriptionAndroidProps;\n}\n\n/**\n * Modern request purchase parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestPurchaseProps = RequestPurchasePropsByPlatforms;\n\n/**\n * Modern request subscription parameters (v2.7.0+)\n * This is the recommended API moving forward\n */\nexport type RequestSubscriptionProps = RequestSubscriptionPropsByPlatforms;\n"]}
@@ -1,114 +0,0 @@
1
- import { PurchaseCommon, ProductCommon } from '../ExpoIap.types';
2
- type ProductAndroidOneTimePurchaseOfferDetail = {
3
- priceCurrencyCode: string;
4
- formattedPrice: string;
5
- priceAmountMicros: string;
6
- };
7
- type PricingPhaseAndroid = {
8
- formattedPrice: string;
9
- priceCurrencyCode: string;
10
- billingPeriod: string;
11
- billingCycleCount: number;
12
- priceAmountMicros: string;
13
- recurrenceMode: number;
14
- };
15
- type PricingPhasesAndroid = {
16
- pricingPhaseList: PricingPhaseAndroid[];
17
- };
18
- type ProductSubscriptionAndroidOfferDetail = {
19
- basePlanId: string;
20
- offerId?: string | null;
21
- offerToken: string;
22
- offerTags: string[];
23
- pricingPhases: PricingPhasesAndroid;
24
- };
25
- export type ProductAndroid = ProductCommon & {
26
- nameAndroid: string;
27
- oneTimePurchaseOfferDetailsAndroid?: ProductAndroidOneTimePurchaseOfferDetail;
28
- platform: 'android';
29
- subscriptionOfferDetailsAndroid?: ProductSubscriptionAndroidOfferDetail[];
30
- };
31
- type ProductSubscriptionAndroidOfferDetails = {
32
- basePlanId: string;
33
- offerId?: string | null;
34
- offerToken: string;
35
- pricingPhases: PricingPhasesAndroid;
36
- offerTags: string[];
37
- };
38
- export type ProductSubscriptionAndroid = ProductAndroid & {
39
- subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];
40
- };
41
- export type RequestPurchaseAndroidProps = {
42
- skus: string[];
43
- obfuscatedAccountIdAndroid?: string;
44
- obfuscatedProfileIdAndroid?: string;
45
- isOfferPersonalized?: boolean;
46
- };
47
- declare enum ReplacementModesAndroid {
48
- UNKNOWN_REPLACEMENT_MODE = 0,
49
- WITH_TIME_PRORATION = 1,
50
- CHARGE_PRORATED_PRICE = 2,
51
- WITHOUT_PRORATION = 3,
52
- CHARGE_FULL_PRICE = 5,
53
- DEFERRED = 6
54
- }
55
- type SubscriptionOffer = {
56
- sku: string;
57
- offerToken: string;
58
- };
59
- export type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {
60
- replacementModeAndroid?: ReplacementModesAndroid;
61
- subscriptionOffers: SubscriptionOffer[];
62
- };
63
- export type ReceiptAndroid = {
64
- autoRenewing: boolean;
65
- betaProduct: boolean;
66
- cancelDate: number | null;
67
- cancelReason: string;
68
- deferredDate: number | null;
69
- deferredSku: number | null;
70
- freeTrialEndDate: number;
71
- gracePeriodEndDate: number;
72
- parentProductId: string;
73
- productId: string;
74
- productType: string;
75
- purchaseDate: number;
76
- quantity: number;
77
- receiptId: string;
78
- renewalDate: number;
79
- term: string;
80
- termSku: string;
81
- testTransaction: boolean;
82
- };
83
- export declare enum FeatureTypeAndroid {
84
- /** Show in-app messages. Included in documentation by the annotations: */
85
- IN_APP_MESSAGING = "IN_APP_MESSAGING",
86
- /** Launch a price change confirmation flow. */
87
- PRICE_CHANGE_CONFIRMATION = "PRICE_CHANGE_CONFIRMATION",
88
- /** Play billing library support for querying and purchasing with ProductDetails. */
89
- PRODUCT_DETAILS = "PRODUCT_DETAILS",
90
- /** Purchase/query for subscriptions. */
91
- SUBSCRIPTIONS = "SUBSCRIPTIONS",
92
- /** Subscriptions update/replace. */
93
- SUBSCRIPTIONS_UPDATE = "SUBSCRIPTIONS_UPDATE"
94
- }
95
- export declare enum PurchaseAndroidState {
96
- UNSPECIFIED_STATE = 0,
97
- PURCHASED = 1,
98
- PENDING = 2
99
- }
100
- export type ProductPurchaseAndroid = PurchaseCommon & {
101
- platform: 'android';
102
- dataAndroid?: string;
103
- signatureAndroid?: string;
104
- autoRenewingAndroid?: boolean;
105
- purchaseStateAndroid?: PurchaseAndroidState;
106
- isAcknowledgedAndroid?: boolean;
107
- packageNameAndroid?: string;
108
- developerPayloadAndroid?: string;
109
- obfuscatedAccountIdAndroid?: string;
110
- obfuscatedProfileIdAndroid?: string;
111
- };
112
- export type PurchaseAndroid = ProductPurchaseAndroid;
113
- export {};
114
- //# sourceMappingURL=ExpoIapAndroid.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoIapAndroid.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,KAAK,wCAAwC,GAAG;IAC9C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB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Aa,kBAAkB;IAC/B,oCAAoC;IACpC,oBAAoB,yBAAyB;CAC9C;AAED,oBAAY,oBAAoB;IAC9B,iBAAiB,IAAI;IACrB,SAAS,IAAI;IACb,OAAO,IAAI;CACZ;AAKD,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC"}
@@ -1,29 +0,0 @@
1
- var ReplacementModesAndroid;
2
- (function (ReplacementModesAndroid) {
3
- ReplacementModesAndroid[ReplacementModesAndroid["UNKNOWN_REPLACEMENT_MODE"] = 0] = "UNKNOWN_REPLACEMENT_MODE";
4
- ReplacementModesAndroid[ReplacementModesAndroid["WITH_TIME_PRORATION"] = 1] = "WITH_TIME_PRORATION";
5
- ReplacementModesAndroid[ReplacementModesAndroid["CHARGE_PRORATED_PRICE"] = 2] = "CHARGE_PRORATED_PRICE";
6
- ReplacementModesAndroid[ReplacementModesAndroid["WITHOUT_PRORATION"] = 3] = "WITHOUT_PRORATION";
7
- ReplacementModesAndroid[ReplacementModesAndroid["CHARGE_FULL_PRICE"] = 5] = "CHARGE_FULL_PRICE";
8
- ReplacementModesAndroid[ReplacementModesAndroid["DEFERRED"] = 6] = "DEFERRED";
9
- })(ReplacementModesAndroid || (ReplacementModesAndroid = {}));
10
- export var FeatureTypeAndroid;
11
- (function (FeatureTypeAndroid) {
12
- /** Show in-app messages. Included in documentation by the annotations: */
13
- FeatureTypeAndroid["IN_APP_MESSAGING"] = "IN_APP_MESSAGING";
14
- /** Launch a price change confirmation flow. */
15
- FeatureTypeAndroid["PRICE_CHANGE_CONFIRMATION"] = "PRICE_CHANGE_CONFIRMATION";
16
- /** Play billing library support for querying and purchasing with ProductDetails. */
17
- FeatureTypeAndroid["PRODUCT_DETAILS"] = "PRODUCT_DETAILS";
18
- /** Purchase/query for subscriptions. */
19
- FeatureTypeAndroid["SUBSCRIPTIONS"] = "SUBSCRIPTIONS";
20
- /** Subscriptions update/replace. */
21
- FeatureTypeAndroid["SUBSCRIPTIONS_UPDATE"] = "SUBSCRIPTIONS_UPDATE";
22
- })(FeatureTypeAndroid || (FeatureTypeAndroid = {}));
23
- export var PurchaseAndroidState;
24
- (function (PurchaseAndroidState) {
25
- PurchaseAndroidState[PurchaseAndroidState["UNSPECIFIED_STATE"] = 0] = "UNSPECIFIED_STATE";
26
- PurchaseAndroidState[PurchaseAndroidState["PURCHASED"] = 1] = "PURCHASED";
27
- PurchaseAndroidState[PurchaseAndroidState["PENDING"] = 2] = "PENDING";
28
- })(PurchaseAndroidState || (PurchaseAndroidState = {}));
29
- //# sourceMappingURL=ExpoIapAndroid.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoIapAndroid.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AAwDA,IAAK,uBAOJ;AAPD,WAAK,uBAAuB;IAC1B,6GAA4B,CAAA;IAC5B,mGAAuB,CAAA;IACvB,uGAAyB,CAAA;IACzB,+FAAqB,CAAA;IACrB,+FAAqB,CAAA;IACrB,6EAAY,CAAA;AACd,CAAC,EAPI,uBAAuB,KAAvB,uBAAuB,QAO3B;AAiCD,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,0EAA0E;IAC1E,2DAAqC,CAAA;IACrC,+CAA+C;IAC/C,6EAAuD,CAAA;IACvD,oFAAoF;IACpF,yDAAmC,CAAA;IACnC,wCAAwC;IACxC,qDAA+B,CAAA;IAC/B,oCAAoC;IACpC,mEAA6C,CAAA;AAC/C,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,yFAAqB,CAAA;IACrB,yEAAa,CAAA;IACb,qEAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\ntype ProductAndroidOneTimePurchaseOfferDetail = {\n priceCurrencyCode: string;\n formattedPrice: string;\n priceAmountMicros: string;\n};\n\ntype PricingPhaseAndroid = {\n formattedPrice: string;\n priceCurrencyCode: string;\n // P1W, P1M, P1Y\n billingPeriod: string;\n billingCycleCount: number;\n priceAmountMicros: string;\n recurrenceMode: number;\n};\n\ntype PricingPhasesAndroid = {\n pricingPhaseList: PricingPhaseAndroid[];\n};\n\ntype ProductSubscriptionAndroidOfferDetail = {\n basePlanId: string;\n offerId?: string | null;\n offerToken: string;\n offerTags: string[];\n pricingPhases: PricingPhasesAndroid;\n};\n\nexport type ProductAndroid = ProductCommon & {\n nameAndroid: string;\n oneTimePurchaseOfferDetailsAndroid?: ProductAndroidOneTimePurchaseOfferDetail;\n platform: 'android';\n subscriptionOfferDetailsAndroid?: ProductSubscriptionAndroidOfferDetail[];\n};\n\ntype ProductSubscriptionAndroidOfferDetails = {\n basePlanId: string;\n offerId?: string | null;\n offerToken: string;\n pricingPhases: PricingPhasesAndroid;\n offerTags: string[];\n};\n\nexport type ProductSubscriptionAndroid = ProductAndroid & {\n subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];\n};\n\nexport type RequestPurchaseAndroidProps = {\n skus: string[];\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n isOfferPersonalized?: boolean; // For AndroidBilling V5 https://developer.android.com/google/play/billing/integrate#personalized-price\n};\n\nenum ReplacementModesAndroid {\n UNKNOWN_REPLACEMENT_MODE = 0,\n WITH_TIME_PRORATION = 1,\n CHARGE_PRORATED_PRICE = 2,\n WITHOUT_PRORATION = 3,\n CHARGE_FULL_PRICE = 5,\n DEFERRED = 6,\n}\n\ntype SubscriptionOffer = {\n sku: string;\n offerToken: string;\n};\n\nexport type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {\n replacementModeAndroid?: ReplacementModesAndroid;\n subscriptionOffers: SubscriptionOffer[];\n};\n\nexport type ReceiptAndroid = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n};\n\nexport enum FeatureTypeAndroid {\n /** Show in-app messages. Included in documentation by the annotations: */\n IN_APP_MESSAGING = 'IN_APP_MESSAGING',\n /** Launch a price change confirmation flow. */\n PRICE_CHANGE_CONFIRMATION = 'PRICE_CHANGE_CONFIRMATION',\n /** Play billing library support for querying and purchasing with ProductDetails. */\n PRODUCT_DETAILS = 'PRODUCT_DETAILS',\n /** Purchase/query for subscriptions. */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Subscriptions update/replace. */\n SUBSCRIPTIONS_UPDATE = 'SUBSCRIPTIONS_UPDATE',\n}\n\nexport enum PurchaseAndroidState {\n UNSPECIFIED_STATE = 0,\n PURCHASED = 1,\n PENDING = 2,\n}\n\n// Legacy naming for backward compatibility\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseAndroid = PurchaseCommon & {\n platform: 'android';\n dataAndroid?: string;\n signatureAndroid?: string;\n autoRenewingAndroid?: boolean;\n purchaseStateAndroid?: PurchaseAndroidState;\n isAcknowledgedAndroid?: boolean;\n packageNameAndroid?: string;\n developerPayloadAndroid?: string;\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n};\n\n// Preferred naming\nexport type PurchaseAndroid = ProductPurchaseAndroid;\n"]}
@@ -1,149 +0,0 @@
1
- import { PurchaseCommon, ProductCommon } from '../ExpoIap.types';
2
- export declare enum ProductTypeIOS {
3
- Consumable = "consumable",
4
- NonConsumable = "nonConsumable",
5
- AutoRenewableSubscription = "autoRenewableSubscription",
6
- NonRenewingSubscription = "nonRenewingSubscription"
7
- }
8
- type SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';
9
- type PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';
10
- type SubscriptionOffer = {
11
- displayPrice: string;
12
- id: string;
13
- paymentMode: PaymentMode;
14
- period: {
15
- unit: SubscriptionIosPeriod;
16
- value: number;
17
- };
18
- periodCount: number;
19
- price: number;
20
- type: 'introductory' | 'promotional';
21
- };
22
- type SubscriptionInfo = {
23
- introductoryOffer?: SubscriptionOffer;
24
- promotionalOffers?: SubscriptionOffer[];
25
- subscriptionGroupId: string;
26
- subscriptionPeriod: {
27
- unit: SubscriptionIosPeriod;
28
- value: number;
29
- };
30
- };
31
- export type ProductIOS = ProductCommon & {
32
- displayNameIOS: string;
33
- isFamilyShareableIOS: boolean;
34
- jsonRepresentationIOS: string;
35
- platform: 'ios';
36
- typeIOS: ProductTypeIOS;
37
- subscriptionInfoIOS?: SubscriptionInfo;
38
- introductoryPriceNumberOfPeriodsIOS?: string;
39
- introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
40
- };
41
- export type Discount = {
42
- identifier: string;
43
- type: string;
44
- numberOfPeriods: string;
45
- price: string;
46
- localizedPrice: string;
47
- paymentMode: PaymentMode;
48
- subscriptionPeriod: string;
49
- };
50
- export type ProductSubscriptionIOS = ProductIOS & {
51
- discountsIOS?: Discount[];
52
- introductoryPriceIOS?: string;
53
- introductoryPriceAsAmountIOS?: string;
54
- introductoryPricePaymentModeIOS?: PaymentMode;
55
- introductoryPriceNumberOfPeriodsIOS?: string;
56
- introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
57
- platform: 'ios';
58
- subscriptionPeriodNumberIOS?: string;
59
- subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;
60
- };
61
- export type PaymentDiscount = {
62
- /**
63
- * A string used to uniquely identify a discount offer for a product.
64
- */
65
- identifier: string;
66
- /**
67
- * A string that identifies the key used to generate the signature.
68
- */
69
- keyIdentifier: string;
70
- /**
71
- * A universally unique ID (UUID) value that you define.
72
- */
73
- nonce: string;
74
- /**
75
- * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.
76
- */
77
- signature: string;
78
- /**
79
- * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.
80
- */
81
- timestamp: number;
82
- };
83
- export type RequestPurchaseIosProps = {
84
- sku: string;
85
- andDangerouslyFinishTransactionAutomatically?: boolean;
86
- /**
87
- * UUID representing user account
88
- */
89
- appAccountToken?: string;
90
- quantity?: number;
91
- withOffer?: PaymentDiscount;
92
- };
93
- type SubscriptionState = 'expired' | 'inBillingRetryPeriod' | 'inGracePeriod' | 'revoked' | 'subscribed';
94
- type RenewalInfo = {
95
- jsonRepresentation?: string;
96
- willAutoRenew: boolean;
97
- autoRenewPreference?: string;
98
- };
99
- export type SubscriptionStatusIOS = {
100
- state: SubscriptionState;
101
- renewalInfo?: RenewalInfo;
102
- };
103
- export type ProductPurchaseIOS = PurchaseCommon & {
104
- platform: 'ios';
105
- quantityIOS?: number;
106
- originalTransactionDateIOS?: number;
107
- originalTransactionIdentifierIOS?: string;
108
- appAccountToken?: string;
109
- expirationDateIOS?: number;
110
- webOrderLineItemIdIOS?: number;
111
- environmentIOS?: string;
112
- storefrontCountryCodeIOS?: string;
113
- appBundleIdIOS?: string;
114
- productTypeIOS?: string;
115
- subscriptionGroupIdIOS?: string;
116
- isUpgradedIOS?: boolean;
117
- ownershipTypeIOS?: string;
118
- reasonIOS?: string;
119
- reasonStringRepresentationIOS?: string;
120
- transactionReasonIOS?: 'PURCHASE' | 'RENEWAL' | string;
121
- revocationDateIOS?: number;
122
- revocationReasonIOS?: string;
123
- offerIOS?: {
124
- id: string;
125
- type: string;
126
- paymentMode: string;
127
- };
128
- currencyCodeIOS?: string;
129
- currencySymbolIOS?: string;
130
- countryCodeIOS?: string;
131
- };
132
- export type PurchaseIOS = ProductPurchaseIOS;
133
- export type AppTransactionIOS = {
134
- appTransactionId?: string;
135
- originalPlatform?: string;
136
- bundleId: string;
137
- appVersion: string;
138
- originalAppVersion: string;
139
- originalPurchaseDate: number;
140
- deviceVerification: string;
141
- deviceVerificationNonce: string;
142
- environment: string;
143
- signedDate: number;
144
- appId?: number;
145
- appVersionId?: number;
146
- preorderDate?: number;
147
- };
148
- export {};
149
- //# sourceMappingURL=ExpoIapIOS.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoIapIOS.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapIOS.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/D,oBAAY,cAAc;IACxB,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,yBAAyB,8BAA8B;IACvD,uBAAuB,4BAA4B;CACpD;AAED,KAAK,qBAAqB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;AACpE,KAAK,WAAW,GAAG,EAAE,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAElE,KAAK,iBAAiB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE;QACN,IAAI,EAAE,qBAAqB,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,E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MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1,8 +0,0 @@
1
- export var ProductTypeIOS;
2
- (function (ProductTypeIOS) {
3
- ProductTypeIOS["Consumable"] = "consumable";
4
- ProductTypeIOS["NonConsumable"] = "nonConsumable";
5
- ProductTypeIOS["AutoRenewableSubscription"] = "autoRenewableSubscription";
6
- ProductTypeIOS["NonRenewingSubscription"] = "nonRenewingSubscription";
7
- })(ProductTypeIOS || (ProductTypeIOS = {}));
8
- //# sourceMappingURL=ExpoIapIOS.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoIapIOS.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapIOS.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,2CAAyB,CAAA;IACzB,iDAA+B,CAAA;IAC/B,yEAAuD,CAAA;IACvD,qEAAmD,CAAA;AACrD,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB","sourcesContent":["import {PurchaseCommon, ProductCommon} from '../ExpoIap.types';\n\nexport enum ProductTypeIOS {\n Consumable = 'consumable',\n NonConsumable = 'nonConsumable',\n AutoRenewableSubscription = 'autoRenewableSubscription',\n NonRenewingSubscription = 'nonRenewingSubscription',\n}\n\ntype SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\ntype PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n\ntype SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\ntype SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupId: string;\n subscriptionPeriod: {\n unit: SubscriptionIosPeriod;\n value: number;\n };\n};\n\nexport type ProductIOS = ProductCommon & {\n displayNameIOS: string;\n isFamilyShareableIOS: boolean;\n jsonRepresentationIOS: string;\n platform: 'ios';\n typeIOS: ProductTypeIOS;\n subscriptionInfoIOS?: SubscriptionInfo;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n};\n\nexport type Discount = {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: PaymentMode;\n subscriptionPeriod: string;\n};\n\nexport type ProductSubscriptionIOS = ProductIOS & {\n discountsIOS?: Discount[];\n introductoryPriceIOS?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?: PaymentMode;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n platform: 'ios';\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n};\n\nexport type PaymentDiscount = {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n};\n\nexport type RequestPurchaseIosProps = {\n sku: string;\n andDangerouslyFinishTransactionAutomatically?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: PaymentDiscount;\n};\n\ntype SubscriptionState =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\ntype RenewalInfo = {\n jsonRepresentation?: string;\n willAutoRenew: boolean;\n autoRenewPreference?: string;\n};\n\nexport type SubscriptionStatusIOS = {\n state: SubscriptionState;\n renewalInfo?: RenewalInfo;\n};\n\n// Legacy naming for backward compatibility\nexport type ProductPurchaseIOS = PurchaseCommon & {\n // iOS basic fields\n platform: 'ios';\n quantityIOS?: number;\n originalTransactionDateIOS?: number;\n originalTransactionIdentifierIOS?: string;\n appAccountToken?: string;\n // iOS additional fields from StoreKit 2\n expirationDateIOS?: number;\n webOrderLineItemIdIOS?: number;\n environmentIOS?: string;\n storefrontCountryCodeIOS?: string;\n appBundleIdIOS?: string;\n productTypeIOS?: string;\n subscriptionGroupIdIOS?: string;\n isUpgradedIOS?: boolean;\n ownershipTypeIOS?: string;\n reasonIOS?: string;\n reasonStringRepresentationIOS?: string;\n transactionReasonIOS?: 'PURCHASE' | 'RENEWAL' | string;\n revocationDateIOS?: number;\n revocationReasonIOS?: string;\n offerIOS?: {\n id: string;\n type: string;\n paymentMode: string;\n };\n // Price locale fields\n currencyCodeIOS?: string;\n currencySymbolIOS?: string;\n countryCodeIOS?: string;\n};\n\n// Preferred naming\nexport type PurchaseIOS = ProductPurchaseIOS;\n\nexport type AppTransactionIOS = {\n appTransactionId?: string; // Only available in iOS 18.4+\n originalPlatform?: string; // Only available in iOS 18.4+\n bundleId: string;\n appVersion: string;\n originalAppVersion: string;\n originalPurchaseDate: number;\n deviceVerification: string;\n deviceVerificationNonce: string;\n environment: string;\n signedDate: number;\n appId?: number;\n appVersionId?: number;\n preorderDate?: number;\n};\n"]}