expo-iap 3.2.0 → 3.3.0-rc.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 (39) hide show
  1. package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +124 -0
  2. package/build/modules/android.d.ts +53 -1
  3. package/build/modules/android.d.ts.map +1 -1
  4. package/build/modules/android.js +61 -0
  5. package/build/modules/android.js.map +1 -1
  6. package/build/types.d.ts +227 -15
  7. package/build/types.d.ts.map +1 -1
  8. package/build/types.js.map +1 -1
  9. package/coverage/clover.xml +57 -51
  10. package/coverage/coverage-final.json +5 -5
  11. package/coverage/lcov-report/block-navigation.js +1 -1
  12. package/coverage/lcov-report/index.html +14 -14
  13. package/coverage/lcov-report/sorter.js +7 -21
  14. package/coverage/lcov-report/src/ExpoIap.types.ts.html +1396 -0
  15. package/coverage/lcov-report/src/helpers/index.html +116 -0
  16. package/coverage/lcov-report/src/helpers/subscription.ts.html +499 -0
  17. package/coverage/lcov-report/src/index.html +1 -1
  18. package/coverage/lcov-report/src/index.ts.html +1 -1
  19. package/coverage/lcov-report/src/modules/android.ts.html +233 -8
  20. package/coverage/lcov-report/src/modules/index.html +15 -15
  21. package/coverage/lcov-report/src/modules/ios.ts.html +1 -1
  22. package/coverage/lcov-report/src/onside/ExpoOnsideMarketplaceAvailabilityModule.ts.html +145 -0
  23. package/coverage/lcov-report/src/onside/index.html +131 -0
  24. package/coverage/lcov-report/src/onside/index.ts.html +253 -0
  25. package/coverage/lcov-report/src/types/ExpoIapAndroid.types.ts.html +502 -0
  26. package/coverage/lcov-report/src/types/index.html +116 -0
  27. package/coverage/lcov-report/src/useIAP.ts.html +1654 -0
  28. package/coverage/lcov-report/src/utils/constants.ts.html +127 -0
  29. package/coverage/lcov-report/src/utils/debug.ts.html +1 -1
  30. package/coverage/lcov-report/src/utils/errorMapping.ts.html +1 -1
  31. package/coverage/lcov-report/src/utils/index.html +1 -1
  32. package/coverage/lcov.info +86 -74
  33. package/ios/expoiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  34. package/ios/expoiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  35. package/openiap-versions.json +2 -2
  36. package/package.json +1 -1
  37. package/plugin/tsconfig.tsbuildinfo +1 -1
  38. package/src/modules/android.ts +75 -0
  39. package/src/types.ts +243 -15
@@ -0,0 +1,127 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/utils/constants.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../prettify.css" />
9
+ <link rel="stylesheet" href="../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/utils</a> constants.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">0% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>0/3</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/0</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">100% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>0/0</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">0% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>0/3</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line low'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a>
78
+ <a name='L13'></a><a href='#L13'>13</a>
79
+ <a name='L14'></a><a href='#L14'>14</a>
80
+ <a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
81
+ <span class="cline-any cline-neutral">&nbsp;</span>
82
+ <span class="cline-any cline-neutral">&nbsp;</span>
83
+ <span class="cline-any cline-neutral">&nbsp;</span>
84
+ <span class="cline-any cline-no">&nbsp;</span>
85
+ <span class="cline-any cline-neutral">&nbsp;</span>
86
+ <span class="cline-any cline-neutral">&nbsp;</span>
87
+ <span class="cline-any cline-neutral">&nbsp;</span>
88
+ <span class="cline-any cline-neutral">&nbsp;</span>
89
+ <span class="cline-any cline-neutral">&nbsp;</span>
90
+ <span class="cline-any cline-no">&nbsp;</span>
91
+ <span class="cline-any cline-neutral">&nbsp;</span>
92
+ <span class="cline-any cline-neutral">&nbsp;</span>
93
+ <span class="cline-any cline-no">&nbsp;</span>
94
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Centralized product ID constants for examples and internal usage
95
+ // Rename guide: subscriptionIds -&gt; SUBSCRIPTION_PRODUCT_IDS, PRODUCT_IDS remains the same name
96
+ &nbsp;
97
+ // One-time purchase product IDs (consumables/non-consumables)
98
+ export const <span class="cstat-no" title="statement not covered" >PRODUCT_IDS: string[] = [</span>
99
+ 'dev.hyo.martie.10bulbs',
100
+ 'dev.hyo.martie.30bulbs',
101
+ ];
102
+ &nbsp;
103
+ // Subscription product IDs
104
+ export const <span class="cstat-no" title="statement not covered" >SUBSCRIPTION_PRODUCT_IDS: string[] = ['dev.hyo.martie.premium'];</span>
105
+ &nbsp;
106
+ // Optionally export a single default subscription for convenience
107
+ export const <span class="cstat-no" title="statement not covered" >DEFAULT_SUBSCRIPTION_PRODUCT_ID = SUBSCRIPTION_PRODUCT_IDS[0];</span>
108
+ &nbsp;</pre></td></tr></table></pre>
109
+
110
+ <div class='push'></div><!-- for sticky footer -->
111
+ </div><!-- /wrapper -->
112
+ <div class='footer quiet pad2 space-top1 center small'>
113
+ Code coverage generated by
114
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
115
+ at 2025-09-10T20:04:36.946Z
116
+ </div>
117
+ <script src="../../prettify.js"></script>
118
+ <script>
119
+ window.onload = function () {
120
+ prettyPrint();
121
+ };
122
+ </script>
123
+ <script src="../../sorter.js"></script>
124
+ <script src="../../block-navigation.js"></script>
125
+ </body>
126
+ </html>
127
+
@@ -268,7 +268,7 @@ export const ExpoIapConsole = createConsole();
268
268
  <div class='footer quiet pad2 space-top1 center small'>
269
269
  Code coverage generated by
270
270
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
271
- at 2025-12-08T21:34:13.986Z
271
+ at 2025-12-11T15:55:28.976Z
272
272
  </div>
273
273
  <script src="../../prettify.js"></script>
274
274
  <script>
@@ -1126,7 +1126,7 @@ export function getUserFriendlyErrorMessage(error: ErrorLike): string {
1126
1126
  <div class='footer quiet pad2 space-top1 center small'>
1127
1127
  Code coverage generated by
1128
1128
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1129
- at 2025-12-08T21:34:13.986Z
1129
+ at 2025-12-11T15:55:28.976Z
1130
1130
  </div>
1131
1131
  <script src="../../prettify.js"></script>
1132
1132
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-08T21:34:13.986Z
119
+ at 2025-12-11T15:55:28.976Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -410,16 +410,19 @@ BRH:98
410
410
  end_of_record
411
411
  TN:
412
412
  SF:src/modules/android.ts
413
- FN:25,isProductAndroid
414
- FN:52,(anonymous_2)
415
- FN:93,(anonymous_3)
416
- FN:138,(anonymous_4)
417
- FN:165,(anonymous_5)
418
- FN:188,(anonymous_6)
419
- FN:218,(anonymous_7)
420
- FN:248,(anonymous_8)
421
- FNF:8
422
- FNH:5
413
+ FN:29,isProductAndroid
414
+ FN:56,(anonymous_2)
415
+ FN:97,(anonymous_3)
416
+ FN:142,(anonymous_4)
417
+ FN:169,(anonymous_5)
418
+ FN:192,(anonymous_6)
419
+ FN:222,(anonymous_7)
420
+ FN:252,(anonymous_8)
421
+ FN:275,(anonymous_9)
422
+ FN:298,(anonymous_10)
423
+ FN:321,(anonymous_11)
424
+ FNF:11
425
+ FNH:8
423
426
  FNDA:8,isProductAndroid
424
427
  FNDA:5,(anonymous_2)
425
428
  FNDA:2,(anonymous_3)
@@ -428,75 +431,84 @@ FNDA:1,(anonymous_5)
428
431
  FNDA:0,(anonymous_6)
429
432
  FNDA:0,(anonymous_7)
430
433
  FNDA:0,(anonymous_8)
434
+ FNDA:4,(anonymous_9)
435
+ FNDA:5,(anonymous_10)
436
+ FNDA:3,(anonymous_11)
431
437
  DA:2,3
432
438
  DA:5,3
433
- DA:22,3
434
- DA:25,3
435
- DA:28,8
436
- DA:52,3
437
- DA:55,5
438
- DA:56,5
439
+ DA:26,3
440
+ DA:29,3
441
+ DA:32,8
442
+ DA:56,3
439
443
  DA:59,5
440
- DA:60,1
441
- DA:67,4
442
- DA:68,3
443
- DA:72,1
444
- DA:75,1
444
+ DA:60,5
445
+ DA:63,5
446
+ DA:64,1
447
+ DA:71,4
448
+ DA:72,3
445
449
  DA:76,1
446
- DA:93,3
447
- DA:106,2
448
- DA:109,2
450
+ DA:79,1
451
+ DA:80,1
452
+ DA:97,3
453
+ DA:110,2
449
454
  DA:113,2
450
- DA:121,2
451
- DA:122,1
452
- DA:127,1
453
- DA:136,3
454
- DA:138,3
455
- DA:139,5
456
- DA:141,5
457
- DA:142,1
458
- DA:145,4
459
- DA:146,3
460
- DA:147,3
461
- DA:148,1
462
- DA:150,2
463
- DA:151,2
464
- DA:155,1
465
- DA:165,3
466
- DA:166,1
467
- DA:186,3
468
- DA:188,3
469
- DA:189,0
470
- DA:216,3
471
- DA:218,3
472
- DA:219,0
473
- DA:246,3
474
- DA:248,3
475
- DA:249,0
476
- LF:45
477
- LH:42
478
- BRDA:29,0,0,8
479
- BRDA:29,0,1,6
480
- BRDA:29,0,2,6
481
- BRDA:29,0,3,5
482
- BRDA:29,0,4,5
483
- BRDA:55,1,0,5
484
- BRDA:55,1,1,1
485
- BRDA:56,2,0,5
486
- BRDA:56,2,1,2
487
- BRDA:59,3,0,1
488
- BRDA:67,4,0,3
489
- BRDA:75,5,0,1
490
- BRDA:75,5,1,0
491
- BRDA:106,6,0,1
492
- BRDA:106,6,1,1
493
- BRDA:121,7,0,1
494
- BRDA:141,8,0,1
495
- BRDA:145,9,0,3
496
- BRDA:145,10,0,4
497
- BRDA:145,10,1,3
498
- BRDA:147,11,0,1
499
- BRDA:150,12,0,2
455
+ DA:117,2
456
+ DA:125,2
457
+ DA:126,1
458
+ DA:131,1
459
+ DA:140,3
460
+ DA:142,3
461
+ DA:143,5
462
+ DA:145,5
463
+ DA:146,1
464
+ DA:149,4
465
+ DA:150,3
466
+ DA:151,3
467
+ DA:152,1
468
+ DA:154,2
469
+ DA:155,2
470
+ DA:159,1
471
+ DA:169,3
472
+ DA:170,1
473
+ DA:190,3
474
+ DA:192,3
475
+ DA:193,0
476
+ DA:220,3
477
+ DA:222,3
478
+ DA:223,0
479
+ DA:250,3
480
+ DA:252,3
481
+ DA:253,0
482
+ DA:275,3
483
+ DA:278,4
484
+ DA:298,3
485
+ DA:301,5
486
+ DA:321,3
487
+ DA:324,3
488
+ LF:51
489
+ LH:48
490
+ BRDA:33,0,0,8
491
+ BRDA:33,0,1,6
492
+ BRDA:33,0,2,6
493
+ BRDA:33,0,3,5
494
+ BRDA:33,0,4,5
495
+ BRDA:59,1,0,5
496
+ BRDA:59,1,1,1
497
+ BRDA:60,2,0,5
498
+ BRDA:60,2,1,2
499
+ BRDA:63,3,0,1
500
+ BRDA:71,4,0,3
501
+ BRDA:79,5,0,1
502
+ BRDA:79,5,1,0
503
+ BRDA:110,6,0,1
504
+ BRDA:110,6,1,1
505
+ BRDA:125,7,0,1
506
+ BRDA:145,8,0,1
507
+ BRDA:149,9,0,3
508
+ BRDA:149,10,0,4
509
+ BRDA:149,10,1,3
510
+ BRDA:151,11,0,1
511
+ BRDA:154,12,0,2
500
512
  BRF:22
501
513
  BRH:21
502
514
  end_of_record
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "apple": "1.3.0",
3
- "google": "1.3.10",
4
- "gql": "1.3.0"
3
+ "google": "1.3.12",
4
+ "gql": "1.3.2"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "3.2.0",
3
+ "version": "3.3.0-rc.1",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1 +1 @@
1
- {"root":["./src/expoConfig.augmentation.d.ts","./src/withIAP.ts","./src/withIosAlternativeBilling.ts","./src/withLocalOpenIAP.ts"],"version":"5.9.3"}
1
+ {"root":["./src/expoconfig.augmentation.d.ts","./src/withiap.ts","./src/withiosalternativebilling.ts","./src/withlocalopeniap.ts"],"version":"5.9.2"}
@@ -6,7 +6,11 @@ import ExpoIapModule from '../ExpoIapModule';
6
6
 
7
7
  // Types
8
8
  import type {
9
+ BillingProgramAndroid,
10
+ BillingProgramAvailabilityResultAndroid,
11
+ BillingProgramReportingDetailsAndroid,
9
12
  DeepLinkOptions,
13
+ LaunchExternalLinkParamsAndroid,
10
14
  MutationField,
11
15
  VerifyPurchaseResultAndroid,
12
16
  } from '../types';
@@ -248,3 +252,74 @@ export const createAlternativeBillingTokenAndroid: MutationField<
248
252
  > = async (sku?: string) => {
249
253
  return ExpoIapModule.createAlternativeBillingTokenAndroid(sku);
250
254
  };
255
+
256
+ // ============================================================================
257
+ // Billing Programs API (Google Play Billing Library 8.2.0+)
258
+ // ============================================================================
259
+
260
+ /**
261
+ * Check if a specific billing program is available for this user/device (Android only).
262
+ * Available in Google Play Billing Library 8.2.0+.
263
+ *
264
+ * @param program - The billing program to check ('external-offer' or 'external-content-link')
265
+ * @returns Promise resolving to availability result
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * const result = await isBillingProgramAvailableAndroid('external-offer');
270
+ * if (result.isAvailable) {
271
+ * // Proceed with billing program flow
272
+ * }
273
+ * ```
274
+ */
275
+ export const isBillingProgramAvailableAndroid = async (
276
+ program: BillingProgramAndroid,
277
+ ): Promise<BillingProgramAvailabilityResultAndroid> => {
278
+ return ExpoIapModule.isBillingProgramAvailableAndroid(program);
279
+ };
280
+
281
+ /**
282
+ * Launch an external link for the specified billing program (Android only).
283
+ * Available in Google Play Billing Library 8.2.0+.
284
+ *
285
+ * @param params - The external link parameters
286
+ * @returns Promise resolving when the link is launched
287
+ *
288
+ * @example
289
+ * ```typescript
290
+ * await launchExternalLinkAndroid({
291
+ * billingProgram: 'external-offer',
292
+ * launchMode: 'launch-in-external-browser-or-app',
293
+ * linkType: 'link-to-digital-content-offer',
294
+ * linkUri: 'https://your-payment-site.com',
295
+ * });
296
+ * ```
297
+ */
298
+ export const launchExternalLinkAndroid = async (
299
+ params: LaunchExternalLinkParamsAndroid,
300
+ ): Promise<void> => {
301
+ return ExpoIapModule.launchExternalLinkAndroid(params);
302
+ };
303
+
304
+ /**
305
+ * Create billing program reporting details for Google Play reporting (Android only).
306
+ * Available in Google Play Billing Library 8.2.0+.
307
+ *
308
+ * Must be called AFTER successful payment in your payment system.
309
+ * Token must be reported to Google Play backend within 24 hours.
310
+ *
311
+ * @param program - The billing program type
312
+ * @returns Promise resolving to reporting details including the external transaction token
313
+ *
314
+ * @example
315
+ * ```typescript
316
+ * const details = await createBillingProgramReportingDetailsAndroid('external-offer');
317
+ * // Report details.externalTransactionToken to Google Play within 24 hours
318
+ * await reportToGooglePlay(details.externalTransactionToken);
319
+ * ```
320
+ */
321
+ export const createBillingProgramReportingDetailsAndroid = async (
322
+ program: BillingProgramAndroid,
323
+ ): Promise<BillingProgramReportingDetailsAndroid> => {
324
+ return ExpoIapModule.createBillingProgramReportingDetailsAndroid(program);
325
+ };