react-native-iap 14.3.6 → 14.3.8

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 (98) hide show
  1. package/README.md +1 -1
  2. package/android/build.gradle +1 -3
  3. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +61 -11
  4. package/ios/HybridRnIap.swift +47 -12
  5. package/lib/module/hooks/useIAP.js +31 -21
  6. package/lib/module/hooks/useIAP.js.map +1 -1
  7. package/lib/module/index.js +629 -700
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/module/types.js +12 -0
  10. package/lib/module/types.js.map +1 -1
  11. package/lib/module/utils/purchase.js +22 -0
  12. package/lib/module/utils/purchase.js.map +1 -0
  13. package/lib/module/utils.js +43 -0
  14. package/lib/module/utils.js.map +1 -0
  15. package/lib/typescript/plugin/src/withIAP.d.ts +1 -0
  16. package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -1
  17. package/lib/typescript/src/hooks/useIAP.d.ts +4 -5
  18. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  19. package/lib/typescript/src/index.d.ts +57 -176
  20. package/lib/typescript/src/index.d.ts.map +1 -1
  21. package/lib/typescript/src/specs/RnIap.nitro.d.ts +113 -154
  22. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  23. package/lib/typescript/src/types.d.ts +99 -76
  24. package/lib/typescript/src/types.d.ts.map +1 -1
  25. package/lib/typescript/src/utils/purchase.d.ts +4 -0
  26. package/lib/typescript/src/utils/purchase.d.ts.map +1 -0
  27. package/lib/typescript/src/utils.d.ts +8 -0
  28. package/lib/typescript/src/utils.d.ts.map +1 -0
  29. package/nitrogen/generated/android/NitroIap+autolinking.cmake +1 -1
  30. package/nitrogen/generated/android/c++/{JNitroSubscriptionOffer.hpp → JAndroidSubscriptionOfferInput.hpp} +15 -15
  31. package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
  32. package/nitrogen/generated/android/c++/JFunc_void_NitroPurchase.hpp +4 -0
  33. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +16 -16
  34. package/nitrogen/generated/android/c++/JHybridRnIapSpec.hpp +1 -1
  35. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +6 -5
  36. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidType.hpp +59 -0
  37. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +2 -1
  38. package/nitrogen/generated/android/c++/JNitroProduct.hpp +22 -20
  39. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +12 -8
  40. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +2 -2
  41. package/nitrogen/generated/android/c++/JNitroReceiptValidationAndroidOptions.hpp +10 -10
  42. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +6 -6
  43. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +4 -0
  44. package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +7 -7
  45. package/nitrogen/generated/android/c++/JRequestPurchaseResult.cpp +39 -0
  46. package/nitrogen/generated/android/c++/JRequestPurchaseResult.hpp +68 -53
  47. package/nitrogen/generated/android/c++/JVariant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.hpp +4 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/{NitroSubscriptionOffer.kt → AndroidSubscriptionOfferInput.kt} +5 -5
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +1 -1
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +1 -1
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidType.kt +21 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +11 -11
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +2 -2
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAndroidOptions.kt +4 -4
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +2 -2
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +1 -1
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +31 -13
  58. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +4 -4
  59. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +99 -64
  60. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +6 -6
  61. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +10 -10
  62. package/nitrogen/generated/ios/swift/{NitroSubscriptionOffer.swift → AndroidSubscriptionOfferInput.swift} +13 -13
  63. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__variant_PurchaseAndroid__PurchaseIOS__std__vector_std__variant_PurchaseAndroid__PurchaseIOS____.swift +81 -0
  64. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -1
  65. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +35 -7
  66. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidOptions.swift +7 -14
  67. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesAndroidType.swift +40 -0
  68. package/nitrogen/generated/ios/swift/NitroProduct.swift +72 -72
  69. package/nitrogen/generated/ios/swift/NitroPurchase.swift +8 -8
  70. package/nitrogen/generated/ios/swift/NitroReceiptValidationAndroidOptions.swift +21 -21
  71. package/nitrogen/generated/ios/swift/NitroReceiptValidationResultAndroid.swift +37 -11
  72. package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +11 -11
  73. package/nitrogen/generated/ios/swift/RequestPurchaseResult.swift +8 -137
  74. package/nitrogen/generated/shared/c++/{NitroSubscriptionOffer.hpp → AndroidSubscriptionOfferInput.hpp} +15 -15
  75. package/nitrogen/generated/shared/c++/HybridRnIapSpec.hpp +9 -6
  76. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +8 -7
  77. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidType.hpp +76 -0
  78. package/nitrogen/generated/shared/c++/NitroProduct.hpp +24 -22
  79. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +15 -10
  80. package/nitrogen/generated/shared/c++/NitroReceiptValidationAndroidOptions.hpp +10 -10
  81. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +9 -9
  82. package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +8 -8
  83. package/package.json +2 -2
  84. package/plugin/build/withIAP.d.ts +1 -0
  85. package/plugin/build/withIAP.js +8 -2
  86. package/plugin/src/withIAP.ts +13 -3
  87. package/src/hooks/useIAP.ts +63 -32
  88. package/src/index.ts +832 -796
  89. package/src/specs/RnIap.nitro.ts +131 -163
  90. package/src/types.ts +131 -85
  91. package/src/utils/purchase.ts +32 -0
  92. package/src/utils.ts +68 -0
  93. package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.cpp +0 -26
  94. package/nitrogen/generated/android/c++/JVariant_PurchaseAndroid_PurchaseIOS.hpp +0 -80
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_PurchaseAndroid_PurchaseIOS.kt +0 -42
  96. package/nitrogen/generated/ios/swift/Func_void_RequestPurchaseResult.swift +0 -47
  97. package/nitrogen/generated/ios/swift/Variant_PurchaseAndroid_PurchaseIOS.swift +0 -18
  98. package/nitrogen/generated/shared/c++/RequestPurchaseResult.hpp +0 -78
@@ -1,7 +1,5 @@
1
1
  import 'react-native-nitro-modules';
2
- import type { NitroPurchaseResult } from './specs/RnIap.nitro';
3
- import type { RequestPurchaseProps, RequestPurchaseResult } from './types';
4
- import type { Product, ProductRequest, Purchase, PurchaseOptions, PurchaseError, SubscriptionStatusIOS } from './types';
2
+ import type { MutationField, Product, ProductIOS, Purchase, PurchaseError, QueryField } from './types';
5
3
  export type { RnIap, NitroProduct, NitroPurchase, NitroPurchaseResult, } from './specs/RnIap.nitro';
6
4
  export * from './types';
7
5
  export * from './utils/error';
@@ -9,22 +7,10 @@ export type ProductTypeInput = 'inapp' | 'in-app' | 'subs';
9
7
  export interface EventSubscription {
10
8
  remove(): void;
11
9
  }
12
- export type FinishTransactionParams = {
13
- purchase: Purchase;
14
- isConsumable?: boolean;
15
- };
16
10
  export { useIAP } from './hooks/useIAP';
17
- export declare const getPromotedProductIOS: () => Promise<Product | null>;
18
- export declare const requestPurchaseOnPromotedProductIOS: () => Promise<void>;
19
- export declare const restorePurchases: (options?: PurchaseOptions) => Promise<Purchase[]>;
20
- /**
21
- * Initialize connection to the store
22
- */
23
- export declare const initConnection: () => Promise<boolean>;
24
- /**
25
- * End connection to the store
26
- */
27
- export declare const endConnection: () => Promise<boolean>;
11
+ export declare const purchaseUpdatedListener: (listener: (purchase: Purchase) => void) => EventSubscription;
12
+ export declare const purchaseErrorListener: (listener: (error: PurchaseError) => void) => EventSubscription;
13
+ export declare const promotedProductListenerIOS: (listener: (product: Product) => void) => EventSubscription;
28
14
  /**
29
15
  * Fetch products from the store
30
16
  * @param params - Product request configuration
@@ -41,46 +27,7 @@ export declare const endConnection: () => Promise<boolean>;
41
27
  * const subscriptions = await fetchProducts({ skus: ['sub1', 'sub2'], type: 'subs' });
42
28
  * ```
43
29
  */
44
- export declare const fetchProducts: ({ skus, type, }: ProductRequest) => Promise<Product[]>;
45
- /**
46
- * Request a purchase for products or subscriptions
47
- * @param params - Purchase request configuration
48
- * @param params.request - Platform-specific purchase parameters
49
- * @param params.type - Type of purchase: 'in-app' for products (default) or 'subs' for subscriptions
50
- *
51
- * @example
52
- * ```typescript
53
- * // Product purchase
54
- * await requestPurchase({
55
- * request: {
56
- * ios: { sku: productId },
57
- * android: { skus: [productId] }
58
- * },
59
- * type: 'in-app'
60
- * });
61
- *
62
- * // Subscription purchase
63
- * await requestPurchase({
64
- * request: {
65
- * ios: { sku: subscriptionId },
66
- * android: {
67
- * skus: [subscriptionId],
68
- * subscriptionOffers: [{ sku: subscriptionId, offerToken: 'token' }]
69
- * }
70
- * },
71
- * type: 'subs'
72
- * });
73
- * ```
74
- */
75
- /**
76
- * Request a purchase for products or subscriptions
77
- * ⚠️ Important: This is an event-based operation, not promise-based.
78
- * Listen for events through purchaseUpdatedListener or purchaseErrorListener.
79
- * @param params - Purchase request configuration
80
- * @param params.request - Platform-specific request parameters
81
- * @param params.type - Type of purchase (defaults to in-app)
82
- */
83
- export declare const requestPurchase: (params: RequestPurchaseProps) => Promise<RequestPurchaseResult>;
30
+ export declare const fetchProducts: QueryField<'fetchProducts'>;
84
31
  /**
85
32
  * Get available purchases (purchased items not yet consumed/finished)
86
33
  * @param params - Options for getting available purchases
@@ -94,12 +41,46 @@ export declare const requestPurchase: (params: RequestPurchaseProps) => Promise<
94
41
  * });
95
42
  * ```
96
43
  */
97
- export declare const getAvailablePurchases: ({ alsoPublishToEventListenerIOS, onlyIncludeActiveItemsIOS, }?: PurchaseOptions) => Promise<Purchase[]>;
44
+ export declare const getAvailablePurchases: QueryField<'getAvailablePurchases'>;
45
+ /**
46
+ * Request the promoted product from the App Store (iOS only)
47
+ * @returns Promise<Product | null> - The promoted product or null if none available
48
+ * @platform iOS
49
+ */
50
+ export declare const getPromotedProductIOS: QueryField<'getPromotedProductIOS'>;
51
+ export declare const requestPromotedProductIOS: () => Promise<ProductIOS | null>;
52
+ export declare const getStorefrontIOS: QueryField<'getStorefrontIOS'>;
53
+ export declare const getAppTransactionIOS: QueryField<'getAppTransactionIOS'>;
54
+ export declare const subscriptionStatusIOS: QueryField<'subscriptionStatusIOS'>;
55
+ export declare const currentEntitlementIOS: QueryField<'currentEntitlementIOS'>;
56
+ export declare const latestTransactionIOS: QueryField<'latestTransactionIOS'>;
57
+ export declare const getPendingTransactionsIOS: QueryField<'getPendingTransactionsIOS'>;
58
+ export declare const showManageSubscriptionsIOS: MutationField<'showManageSubscriptionsIOS'>;
59
+ export declare const isEligibleForIntroOfferIOS: QueryField<'isEligibleForIntroOfferIOS'>;
60
+ export declare const getReceiptDataIOS: QueryField<'getReceiptDataIOS'>;
61
+ export declare const isTransactionVerifiedIOS: QueryField<'isTransactionVerifiedIOS'>;
62
+ export declare const getTransactionJwsIOS: QueryField<'getTransactionJwsIOS'>;
63
+ /**
64
+ * Initialize connection to the store
65
+ */
66
+ export declare const initConnection: MutationField<'initConnection'>;
67
+ /**
68
+ * End connection to the store
69
+ */
70
+ export declare const endConnection: MutationField<'endConnection'>;
71
+ export declare const restorePurchases: MutationField<'restorePurchases'>;
72
+ /**
73
+ * Request a purchase for products or subscriptions
74
+ * ⚠️ Important: This is an event-based operation, not promise-based.
75
+ * Listen for events through purchaseUpdatedListener or purchaseErrorListener.
76
+ */
77
+ export declare const requestPurchase: MutationField<'requestPurchase'>;
98
78
  /**
99
79
  * Finish a transaction (consume or acknowledge)
100
80
  * @param params - Transaction finish parameters
101
81
  * @param params.purchase - The purchase to finish
102
82
  * @param params.isConsumable - Whether this is a consumable product (Android only)
83
+ * @returns Promise<void> - Resolves when the transaction is successfully finished
103
84
  *
104
85
  * @example
105
86
  * ```typescript
@@ -109,146 +90,67 @@ export declare const getAvailablePurchases: ({ alsoPublishToEventListenerIOS, on
109
90
  * });
110
91
  * ```
111
92
  */
112
- export declare const finishTransaction: ({ purchase, isConsumable, }: FinishTransactionParams) => Promise<NitroPurchaseResult | boolean>;
93
+ export declare const finishTransaction: MutationField<'finishTransaction'>;
113
94
  /**
114
95
  * Acknowledge a purchase (Android only)
115
96
  * @param purchaseToken - The purchase token to acknowledge
97
+ * @returns Promise<boolean> - Indicates whether the acknowledgement succeeded
116
98
  *
117
99
  * @example
118
100
  * ```typescript
119
101
  * await acknowledgePurchaseAndroid('purchase_token_here');
120
102
  * ```
121
103
  */
122
- export declare const acknowledgePurchaseAndroid: (purchaseToken: string) => Promise<NitroPurchaseResult>;
104
+ export declare const acknowledgePurchaseAndroid: MutationField<'acknowledgePurchaseAndroid'>;
123
105
  /**
124
106
  * Consume a purchase (Android only)
125
107
  * @param purchaseToken - The purchase token to consume
108
+ * @returns Promise<boolean> - Indicates whether the consumption succeeded
126
109
  *
127
110
  * @example
128
111
  * ```typescript
129
112
  * await consumePurchaseAndroid('purchase_token_here');
130
113
  * ```
131
114
  */
132
- export declare const consumePurchaseAndroid: (purchaseToken: string) => Promise<NitroPurchaseResult>;
133
- /**
134
- * Purchase updated event listener
135
- * Fired when a purchase is successful or when a pending purchase is completed.
136
- *
137
- * @param listener - Function to call when a purchase is updated
138
- * @returns EventSubscription object with remove method
139
- *
140
- * @example
141
- * ```typescript
142
- * const subscription = purchaseUpdatedListener((purchase) => {
143
- * console.log('Purchase successful:', purchase);
144
- * // 1. Validate receipt with backend
145
- * // 2. Deliver content to user
146
- * // 3. Call finishTransaction to acknowledge
147
- * });
148
- *
149
- * // Later, clean up
150
- * subscription.remove();
151
- * ```
152
- */
153
- export declare const purchaseUpdatedListener: (listener: (purchase: Purchase) => void) => EventSubscription;
154
- /**
155
- * Purchase error event listener
156
- * Fired when a purchase fails or is cancelled by the user.
157
- *
158
- * @param listener - Function to call when a purchase error occurs
159
- * @returns EventSubscription object with remove method
160
- *
161
- * @example
162
- * ```typescript
163
- * const subscription = purchaseErrorListener((error) => {
164
- * switch (error.code) {
165
- * case 'E_USER_CANCELLED':
166
- * // User cancelled - no action needed
167
- * break;
168
- * case 'E_ITEM_UNAVAILABLE':
169
- * // Product not available
170
- * break;
171
- * case 'E_NETWORK_ERROR':
172
- * // Retry with backoff
173
- * break;
174
- * }
175
- * });
176
- *
177
- * // Later, clean up
178
- * subscription.remove();
179
- * ```
180
- */
181
- export declare const purchaseErrorListener: (listener: (error: PurchaseError) => void) => EventSubscription;
182
- /**
183
- * iOS-only listener for App Store promoted product events.
184
- * Fired when a user clicks on a promoted in-app purchase in the App Store.
185
- *
186
- * @param listener - Callback function that receives the promoted product
187
- * @returns EventSubscription object with remove method
188
- *
189
- * @example
190
- * ```typescript
191
- * const subscription = promotedProductListenerIOS((product) => {
192
- * console.log('Promoted product:', product);
193
- * // Trigger purchase flow for the promoted product
194
- * });
195
- *
196
- * // Later, clean up
197
- * subscription.remove();
198
- * ```
199
- *
200
- * @platform iOS
201
- */
202
- export declare const promotedProductListenerIOS: (listener: (product: Product) => void) => EventSubscription;
115
+ export declare const consumePurchaseAndroid: MutationField<'consumePurchaseAndroid'>;
203
116
  /**
204
117
  * Validate receipt on both iOS and Android platforms
205
118
  * @param sku - Product SKU
206
119
  * @param androidOptions - Android-specific validation options (required for Android)
207
120
  * @returns Promise<ReceiptValidationResultIOS | ReceiptValidationResultAndroid> - Platform-specific receipt validation result
208
121
  */
209
- export declare const validateReceipt: (sku: string, androidOptions?: {
210
- packageName: string;
211
- productToken: string;
212
- accessToken: string;
213
- isSub?: boolean;
214
- }) => Promise<import("./types").ReceiptValidationResult>;
122
+ export declare const validateReceipt: MutationField<'validateReceipt'>;
215
123
  /**
216
124
  * Sync iOS purchases with App Store (iOS only)
217
125
  * @returns Promise<boolean>
218
126
  * @platform iOS
219
127
  */
220
- export declare const syncIOS: () => Promise<boolean>;
221
- /**
222
- * Request the promoted product from the App Store (iOS only)
223
- * @returns Promise<Product | null> - The promoted product or null if none available
224
- * @platform iOS
225
- */
226
- export declare const requestPromotedProductIOS: () => Promise<Product | null>;
128
+ export declare const syncIOS: MutationField<'syncIOS'>;
227
129
  /**
228
130
  * Present the code redemption sheet for offer codes (iOS only)
229
- * @returns Promise<boolean> - True if the sheet was presented successfully
131
+ * @returns Promise<boolean> - Indicates whether the redemption sheet was presented
230
132
  * @platform iOS
231
133
  */
232
- export declare const presentCodeRedemptionSheetIOS: () => Promise<boolean>;
134
+ export declare const presentCodeRedemptionSheetIOS: MutationField<'presentCodeRedemptionSheetIOS'>;
233
135
  /**
234
136
  * Buy promoted product on iOS
235
- * @returns Promise<void>
137
+ * @returns Promise<boolean> - true when the request triggers successfully
236
138
  * @platform iOS
237
139
  */
238
- export declare const buyPromotedProductIOS: () => Promise<void>;
140
+ export declare const requestPurchaseOnPromotedProductIOS: MutationField<'requestPurchaseOnPromotedProductIOS'>;
239
141
  /**
240
142
  * Clear unfinished transactions on iOS
241
- * @returns Promise<void>
143
+ * @returns Promise<boolean>
242
144
  * @platform iOS
243
145
  */
244
- export declare const clearTransactionIOS: () => Promise<void>;
146
+ export declare const clearTransactionIOS: MutationField<'clearTransactionIOS'>;
245
147
  /**
246
148
  * Begin a refund request for a product on iOS 15+
247
149
  * @param sku - The product SKU to refund
248
150
  * @returns Promise<string | null> - The refund status or null if not available
249
151
  * @platform iOS
250
152
  */
251
- export declare const beginRefundRequestIOS: (sku: string) => Promise<string | null>;
153
+ export declare const beginRefundRequestIOS: MutationField<'beginRefundRequestIOS'>;
252
154
  /**
253
155
  * Get subscription status for a product (iOS only)
254
156
  * @param sku - The product SKU
@@ -256,60 +158,51 @@ export declare const beginRefundRequestIOS: (sku: string) => Promise<string | nu
256
158
  * @throws Error when called on non-iOS platforms or when IAP is not initialized
257
159
  * @platform iOS
258
160
  */
259
- export declare const subscriptionStatusIOS: (sku: string) => Promise<SubscriptionStatusIOS[]>;
260
161
  /**
261
162
  * Get current entitlement for a product (iOS only)
262
163
  * @param sku - The product SKU
263
164
  * @returns Promise<Purchase | null> - Current entitlement or null
264
165
  * @platform iOS
265
166
  */
266
- export declare const currentEntitlementIOS: (sku: string) => Promise<Purchase | null>;
267
167
  /**
268
168
  * Get latest transaction for a product (iOS only)
269
169
  * @param sku - The product SKU
270
170
  * @returns Promise<Purchase | null> - Latest transaction or null
271
171
  * @platform iOS
272
172
  */
273
- export declare const latestTransactionIOS: (sku: string) => Promise<Purchase | null>;
274
173
  /**
275
174
  * Get pending transactions (iOS only)
276
175
  * @returns Promise<Purchase[]> - Array of pending transactions
277
176
  * @platform iOS
278
177
  */
279
- export declare const getPendingTransactionsIOS: () => Promise<Purchase[]>;
280
178
  /**
281
179
  * Show manage subscriptions screen (iOS only)
282
180
  * @returns Promise<Purchase[]> - Subscriptions where auto-renewal status changed
283
181
  * @platform iOS
284
182
  */
285
- export declare const showManageSubscriptionsIOS: () => Promise<Purchase[]>;
286
183
  /**
287
184
  * Check if user is eligible for intro offer (iOS only)
288
185
  * @param groupID - The subscription group ID
289
186
  * @returns Promise<boolean> - Eligibility status
290
187
  * @platform iOS
291
188
  */
292
- export declare const isEligibleForIntroOfferIOS: (groupID: string) => Promise<boolean>;
293
189
  /**
294
190
  * Get receipt data (iOS only)
295
191
  * @returns Promise<string> - Base64 encoded receipt data
296
192
  * @platform iOS
297
193
  */
298
- export declare const getReceiptDataIOS: () => Promise<string>;
299
194
  /**
300
195
  * Check if transaction is verified (iOS only)
301
196
  * @param sku - The product SKU
302
197
  * @returns Promise<boolean> - Verification status
303
198
  * @platform iOS
304
199
  */
305
- export declare const isTransactionVerifiedIOS: (sku: string) => Promise<boolean>;
306
200
  /**
307
201
  * Get transaction JWS representation (iOS only)
308
202
  * @param sku - The product SKU
309
203
  * @returns Promise<string | null> - JWS representation or null
310
204
  * @platform iOS
311
205
  */
312
- export declare const getTransactionJwsIOS: (sku: string) => Promise<string | null>;
313
206
  /**
314
207
  * Get the storefront identifier for the user's App Store account (iOS only)
315
208
  * @returns Promise<string> - The storefront identifier (e.g., 'USA' for United States)
@@ -321,22 +214,11 @@ export declare const getTransactionJwsIOS: (sku: string) => Promise<string | nul
321
214
  * console.log('User storefront:', storefront); // e.g., 'USA', 'GBR', 'KOR'
322
215
  * ```
323
216
  */
324
- export declare const getStorefrontIOS: () => Promise<string>;
325
- /**
326
- * Gets the storefront country code from the underlying native store.
327
- * Returns a two-letter country code such as 'US', 'KR', or empty string on failure.
328
- *
329
- * Cross-platform alias aligning with expo-iap.
330
- */
331
- export declare const getStorefront: () => Promise<string>;
332
217
  /**
333
218
  * Deeplinks to native interface that allows users to manage their subscriptions
334
219
  * Cross-platform alias aligning with expo-iap
335
220
  */
336
- export declare const deepLinkToSubscriptions: (options?: {
337
- skuAndroid?: string;
338
- packageNameAndroid?: string;
339
- }) => Promise<void>;
221
+ export declare const deepLinkToSubscriptions: MutationField<'deepLinkToSubscriptions'>;
340
222
  /**
341
223
  * iOS only - Gets the original app transaction ID if the app was purchased from the App Store
342
224
  * @platform iOS
@@ -356,15 +238,14 @@ export declare const deepLinkToSubscriptions: (options?: {
356
238
  * }
357
239
  * ```
358
240
  */
359
- export declare const getAppTransactionIOS: () => Promise<string | null>;
360
241
  export { getActiveSubscriptions, hasActiveSubscriptions, } from './helpers/subscription';
361
242
  export { convertNitroProductToProduct, convertNitroPurchaseToPurchase, convertProductToProductSubscription, validateNitroProduct, validateNitroPurchase, checkTypeSynchronization, } from './utils/type-bridge';
362
243
  /**
363
244
  * @deprecated Use acknowledgePurchaseAndroid instead
364
245
  */
365
- export declare const acknowledgePurchase: (purchaseToken: string) => Promise<NitroPurchaseResult>;
246
+ export declare const acknowledgePurchase: (args: string) => Promise<boolean>;
366
247
  /**
367
248
  * @deprecated Use consumePurchaseAndroid instead
368
249
  */
369
- export declare const consumePurchase: (purchaseToken: string) => Promise<NitroPurchaseResult>;
250
+ export declare const consumePurchase: (args: string) => Promise<boolean>;
370
251
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAEV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,QAAQ,EAER,eAAe,EACf,aAAa,EASb,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAYjB,YAAY,EACV,KAAK,EACL,YAAY,EACZ,aAAa,EACb,mBAAmB,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