expo-iap 3.2.1 → 3.3.0-rc.2
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.
- package/coverage/clover.xml +7 -7
- package/coverage/coverage-final.json +5 -5
- package/coverage/lcov-report/block-navigation.js +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/sorter.js +7 -21
- package/coverage/lcov-report/src/ExpoIap.types.ts.html +1396 -0
- package/coverage/lcov-report/src/helpers/index.html +116 -0
- package/coverage/lcov-report/src/helpers/subscription.ts.html +499 -0
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/modules/android.ts.html +1 -1
- package/coverage/lcov-report/src/modules/index.html +1 -1
- package/coverage/lcov-report/src/modules/ios.ts.html +1 -1
- package/coverage/lcov-report/src/onside/ExpoOnsideMarketplaceAvailabilityModule.ts.html +145 -0
- package/coverage/lcov-report/src/onside/index.html +131 -0
- package/coverage/lcov-report/src/onside/index.ts.html +253 -0
- package/coverage/lcov-report/src/types/ExpoIapAndroid.types.ts.html +502 -0
- package/coverage/lcov-report/src/types/index.html +116 -0
- package/coverage/lcov-report/src/useIAP.ts.html +1654 -0
- package/coverage/lcov-report/src/utils/constants.ts.html +127 -0
- package/coverage/lcov-report/src/utils/debug.ts.html +1 -1
- package/coverage/lcov-report/src/utils/errorMapping.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/ios/expoiap.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/expoiap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/package.json +1 -1
- package/plugin/build/withIAP.d.ts +5 -8
- package/plugin/build/withIAP.js +3 -12
- package/plugin/src/withIAP.ts +9 -18
- package/plugin/tsconfig.tsbuildinfo +1 -1
|
@@ -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"> </span>
|
|
81
|
+
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<span class="cline-any cline-neutral"> </span>
|
|
83
|
+
<span class="cline-any cline-neutral"> </span>
|
|
84
|
+
<span class="cline-any cline-no"> </span>
|
|
85
|
+
<span class="cline-any cline-neutral"> </span>
|
|
86
|
+
<span class="cline-any cline-neutral"> </span>
|
|
87
|
+
<span class="cline-any cline-neutral"> </span>
|
|
88
|
+
<span class="cline-any cline-neutral"> </span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-no"> </span>
|
|
91
|
+
<span class="cline-any cline-neutral"> </span>
|
|
92
|
+
<span class="cline-any cline-neutral"> </span>
|
|
93
|
+
<span class="cline-any cline-no"> </span>
|
|
94
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// Centralized product ID constants for examples and internal usage
|
|
95
|
+
// Rename guide: subscriptionIds -> SUBSCRIPTION_PRODUCT_IDS, PRODUCT_IDS remains the same name
|
|
96
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
</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-
|
|
271
|
+
at 2025-12-13T05:45:54.833Z
|
|
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-
|
|
1129
|
+
at 2025-12-13T05:45:54.833Z
|
|
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-
|
|
119
|
+
at 2025-12-13T05:45:54.833Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
package/package.json
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfigPlugin } from 'expo/config-plugins';
|
|
2
2
|
import { withIosAlternativeBilling, type IOSAlternativeBillingConfig } from './withIosAlternativeBilling';
|
|
3
3
|
export interface ExpoIapPluginOptions {
|
|
4
|
-
/**
|
|
5
|
-
* IAPKit API key for server-side receipt verification.
|
|
6
|
-
* Get your API key from https://iapkit.com
|
|
7
|
-
* This will be available via `Constants.expoConfig?.extra?.iapkitApiKey`
|
|
8
|
-
*/
|
|
9
|
-
iapkitApiKey?: string;
|
|
10
4
|
/** Local development path for OpenIAP library */
|
|
11
5
|
localPath?: string | {
|
|
12
6
|
ios?: string;
|
|
@@ -52,8 +46,11 @@ export interface ExpoIapPluginOptions {
|
|
|
52
46
|
*/
|
|
53
47
|
horizonAppId?: string;
|
|
54
48
|
};
|
|
49
|
+
/** @deprecated Use ios.alternativeBilling instead */
|
|
50
|
+
iosAlternativeBilling?: IOSAlternativeBillingConfig;
|
|
51
|
+
/** @deprecated Use android.horizonAppId instead */
|
|
52
|
+
horizonAppId?: string;
|
|
55
53
|
}
|
|
56
|
-
|
|
57
|
-
export { withIosAlternativeBilling, withIap };
|
|
54
|
+
export { withIosAlternativeBilling };
|
|
58
55
|
declare const _default: ConfigPlugin<void | ExpoIapPluginOptions>;
|
|
59
56
|
export default _default;
|
package/plugin/build/withIAP.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.withIosAlternativeBilling = void 0;
|
|
40
40
|
const config_plugins_1 = require("expo/config-plugins");
|
|
41
41
|
const fs = __importStar(require("fs"));
|
|
42
42
|
const path = __importStar(require("path"));
|
|
@@ -219,18 +219,10 @@ const withIapIOS = (config, options) => {
|
|
|
219
219
|
};
|
|
220
220
|
const withIap = (config, options) => {
|
|
221
221
|
try {
|
|
222
|
-
// Add iapkitApiKey to extra if provided
|
|
223
|
-
if (options?.iapkitApiKey) {
|
|
224
|
-
config.extra = {
|
|
225
|
-
...config.extra,
|
|
226
|
-
iapkitApiKey: options.iapkitApiKey,
|
|
227
|
-
};
|
|
228
|
-
logOnce('🔑 [expo-iap] Added iapkitApiKey to config.extra');
|
|
229
|
-
}
|
|
230
222
|
// Read Horizon configuration from modules
|
|
231
223
|
const isHorizonEnabled = options?.modules?.horizon ?? false;
|
|
232
|
-
const horizonAppId = options?.android?.horizonAppId;
|
|
233
|
-
const iosAlternativeBilling = options?.ios?.alternativeBilling;
|
|
224
|
+
const horizonAppId = options?.android?.horizonAppId ?? options?.horizonAppId;
|
|
225
|
+
const iosAlternativeBilling = options?.ios?.alternativeBilling ?? options?.iosAlternativeBilling;
|
|
234
226
|
logOnce(`🔍 [expo-iap] Config values: horizonAppId=${horizonAppId}, isHorizonEnabled=${isHorizonEnabled}`);
|
|
235
227
|
// Respect explicit flag; fall back to presence of localPath only when flag is unset
|
|
236
228
|
const isLocalDev = options?.enableLocalDev ?? !!options?.localPath;
|
|
@@ -278,5 +270,4 @@ const withIap = (config, options) => {
|
|
|
278
270
|
return config;
|
|
279
271
|
}
|
|
280
272
|
};
|
|
281
|
-
exports.withIap = withIap;
|
|
282
273
|
exports.default = (0, config_plugins_1.createRunOncePlugin)(withIap, pkg.name, pkg.version);
|
package/plugin/src/withIAP.ts
CHANGED
|
@@ -289,12 +289,6 @@ const withIapIOS: ConfigPlugin<IOSAlternativeBillingConfig | undefined> = (
|
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
export interface ExpoIapPluginOptions {
|
|
292
|
-
/**
|
|
293
|
-
* IAPKit API key for server-side receipt verification.
|
|
294
|
-
* Get your API key from https://iapkit.com
|
|
295
|
-
* This will be available via `Constants.expoConfig?.extra?.iapkitApiKey`
|
|
296
|
-
*/
|
|
297
|
-
iapkitApiKey?: string;
|
|
298
292
|
/** Local development path for OpenIAP library */
|
|
299
293
|
localPath?:
|
|
300
294
|
| string
|
|
@@ -342,6 +336,10 @@ export interface ExpoIapPluginOptions {
|
|
|
342
336
|
*/
|
|
343
337
|
horizonAppId?: string;
|
|
344
338
|
};
|
|
339
|
+
/** @deprecated Use ios.alternativeBilling instead */
|
|
340
|
+
iosAlternativeBilling?: IOSAlternativeBillingConfig;
|
|
341
|
+
/** @deprecated Use android.horizonAppId instead */
|
|
342
|
+
horizonAppId?: string;
|
|
345
343
|
}
|
|
346
344
|
|
|
347
345
|
const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
|
|
@@ -349,20 +347,13 @@ const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
|
|
|
349
347
|
options,
|
|
350
348
|
) => {
|
|
351
349
|
try {
|
|
352
|
-
// Add iapkitApiKey to extra if provided
|
|
353
|
-
if (options?.iapkitApiKey) {
|
|
354
|
-
config.extra = {
|
|
355
|
-
...config.extra,
|
|
356
|
-
iapkitApiKey: options.iapkitApiKey,
|
|
357
|
-
};
|
|
358
|
-
logOnce('🔑 [expo-iap] Added iapkitApiKey to config.extra');
|
|
359
|
-
}
|
|
360
|
-
|
|
361
350
|
// Read Horizon configuration from modules
|
|
362
351
|
const isHorizonEnabled = options?.modules?.horizon ?? false;
|
|
363
352
|
|
|
364
|
-
const horizonAppId =
|
|
365
|
-
|
|
353
|
+
const horizonAppId =
|
|
354
|
+
options?.android?.horizonAppId ?? options?.horizonAppId;
|
|
355
|
+
const iosAlternativeBilling =
|
|
356
|
+
options?.ios?.alternativeBilling ?? options?.iosAlternativeBilling;
|
|
366
357
|
|
|
367
358
|
logOnce(
|
|
368
359
|
`🔍 [expo-iap] Config values: horizonAppId=${horizonAppId}, isHorizonEnabled=${isHorizonEnabled}`,
|
|
@@ -425,5 +416,5 @@ const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
|
|
|
425
416
|
}
|
|
426
417
|
};
|
|
427
418
|
|
|
428
|
-
export {withIosAlternativeBilling
|
|
419
|
+
export {withIosAlternativeBilling};
|
|
429
420
|
export default createRunOncePlugin(withIap, pkg.name, pkg.version);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/
|
|
1
|
+
{"root":["./src/expoconfig.augmentation.d.ts","./src/withiap.ts","./src/withiosalternativebilling.ts","./src/withlocalopeniap.ts"],"version":"5.9.2"}
|