expo-iap 3.4.12 → 3.4.13

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.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1774435834715" clover="3.2.0">
3
- <project timestamp="1774435834715" name="All files">
2
+ <coverage generated="1774548212878" clover="3.2.0">
3
+ <project timestamp="1774548212878" name="All files">
4
4
  <metrics statements="528" coveredstatements="493" conditionals="274" coveredconditionals="241" methods="116" coveredmethods="92" elements="918" coveredelements="826" complexity="0" loc="528" ncloc="528" packages="4" files="7" classes="7"/>
5
5
  <package name="src">
6
6
  <metrics statements="224" coveredstatements="216" conditionals="118" coveredconditionals="109" methods="48" coveredmethods="37"/>
@@ -146,7 +146,7 @@
146
146
  <div class='footer quiet pad2 space-top1 center small'>
147
147
  Code coverage generated by
148
148
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
149
- at 2026-03-25T10:50:34.698Z
149
+ at 2026-03-26T18:03:32.860Z
150
150
  </div>
151
151
  <script src="prettify.js"></script>
152
152
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2026-03-25T10:50:34.698Z
104
+ at 2026-03-26T18:03:32.860Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -2842,7 +2842,7 @@ export {<span class="fstat-no" title="function not covered" >ExpoIapConsole}</sp
2842
2842
  <div class='footer quiet pad2 space-top1 center small'>
2843
2843
  Code coverage generated by
2844
2844
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
2845
- at 2026-03-25T10:50:34.698Z
2845
+ at 2026-03-26T18:03:32.860Z
2846
2846
  </div>
2847
2847
  <script src="../prettify.js"></script>
2848
2848
  <script>
@@ -1033,7 +1033,7 @@ export const createBillingProgramReportingDetailsAndroid: MutationField&lt;
1033
1033
  <div class='footer quiet pad2 space-top1 center small'>
1034
1034
  Code coverage generated by
1035
1035
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1036
- at 2026-03-25T10:50:34.698Z
1036
+ at 2026-03-26T18:03:32.860Z
1037
1037
  </div>
1038
1038
  <script src="../../prettify.js"></script>
1039
1039
  <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 2026-03-25T10:50:34.698Z
119
+ at 2026-03-26T18:03:32.860Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -1513,7 +1513,7 @@ export const showExternalPurchaseCustomLinkNoticeIOS = async (
1513
1513
  <div class='footer quiet pad2 space-top1 center small'>
1514
1514
  Code coverage generated by
1515
1515
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1516
- at 2026-03-25T10:50:34.698Z
1516
+ at 2026-03-26T18:03:32.860Z
1517
1517
  </div>
1518
1518
  <script src="../../prettify.js"></script>
1519
1519
  <script>
@@ -130,7 +130,7 @@ export const ExpoOnsideMarketplaceAvailabilityModule: NativeModuleType =
130
130
  <div class='footer quiet pad2 space-top1 center small'>
131
131
  Code coverage generated by
132
132
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
133
- at 2026-03-25T10:50:34.698Z
133
+ at 2026-03-26T18:03:32.860Z
134
134
  </div>
135
135
  <script src="../../prettify.js"></script>
136
136
  <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 2026-03-25T10:50:34.698Z
119
+ at 2026-03-26T18:03:32.860Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -241,7 +241,7 @@ export {checkInstallationFromOnside, installedFromOnside, useOnside};
241
241
  <div class='footer quiet pad2 space-top1 center small'>
242
242
  Code coverage generated by
243
243
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
244
- at 2026-03-25T10:50:34.698Z
244
+ at 2026-03-26T18:03:32.860Z
245
245
  </div>
246
246
  <script src="../../prettify.js"></script>
247
247
  <script>
@@ -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 2026-03-25T10:50:34.698Z
271
+ at 2026-03-26T18:03:32.860Z
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 2026-03-25T10:50:34.698Z
1129
+ at 2026-03-26T18:03:32.860Z
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 2026-03-25T10:50:34.698Z
119
+ at 2026-03-26T18:03:32.860Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -26,9 +26,12 @@ Pod::Spec.new do |s|
26
26
  s.dependency 'ExpoModulesCore'
27
27
  s.dependency 'openiap', "#{versions['apple']}"
28
28
 
29
- # OnsideKit is handled as a separate pod entry in the Podfile (not a subspec)
30
- # to avoid CocoaPods resolving it when not needed.
31
- # The Expo plugin adds `pod 'OnsideKit'` to the Podfile when modules.onside is enabled.
29
+ # OnsideKit dependency is conditionally included via ENV var set by the Expo plugin.
30
+ # When modules.onside is enabled, the plugin prepends ENV['EXPO_IAP_ONSIDE']='1' to the
31
+ # Podfile, which makes this dependency active and enables #if canImport(OnsideKit) in Swift.
32
+ if ENV['EXPO_IAP_ONSIDE'] == '1'
33
+ s.dependency 'OnsideKit'
34
+ end
32
35
 
33
36
  # Swift/Objective-C compatibility
34
37
  s.pod_target_xcconfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "3.4.12",
3
+ "version": "3.4.13",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -197,22 +197,15 @@ const withIapAndroid = (config, props) => {
197
197
  });
198
198
  return config;
199
199
  };
200
- const EXPO_IAP_IOS_PATH = '../node_modules/expo-iap/ios';
201
200
  const ensureOnsidePodIOS = (content) => {
202
- // Check for both old subspec format and new direct pod format
203
- if (/^\s*pod\s+['"]ExpoIap\/Onside['"].*$/m.test(content) ||
204
- /^\s*pod\s+['"]OnsideKit['"].*$/m.test(content)) {
201
+ // Set EXPO_IAP_ONSIDE env var at the top of the Podfile so that the ExpoIap podspec
202
+ // conditionally adds OnsideKit as a dependency. This makes #if canImport(OnsideKit)
203
+ // work inside ExpoIap's Swift source files.
204
+ if (content.includes("ENV['EXPO_IAP_ONSIDE'] = '1'")) {
205
205
  return content;
206
206
  }
207
- const targetMatch = content.match(/target\s+'[^']+'\s+do\s*\n/);
208
- if (!targetMatch) {
209
- config_plugins_1.WarningAggregator.addWarningIOS('expo-iap', 'Could not find a target block in Podfile when adding OnsideKit; skipping installation.');
210
- return content;
211
- }
212
- const podLine = ` pod 'OnsideKit'\n`;
213
- const insertIndex = targetMatch.index + targetMatch[0].length;
214
- logOnce('📦 expo-iap: Added OnsideKit pod to Podfile');
215
- return content.slice(0, insertIndex) + podLine + content.slice(insertIndex);
207
+ logOnce('📦 expo-iap: Enabled OnsideKit (EXPO_IAP_ONSIDE=1)');
208
+ return `ENV['EXPO_IAP_ONSIDE'] = '1'\n` + content;
216
209
  };
217
210
  exports.ensureOnsidePodIOS = ensureOnsidePodIOS;
218
211
  function computeAutolinkModules(existing, desired) {
@@ -262,32 +262,17 @@ const withIapAndroid: ConfigPlugin<
262
262
  return config;
263
263
  };
264
264
 
265
- const EXPO_IAP_IOS_PATH = '../node_modules/expo-iap/ios';
266
-
267
265
  export const ensureOnsidePodIOS = (content: string): string => {
268
- // Check for both old subspec format and new direct pod format
269
- if (
270
- /^\s*pod\s+['"]ExpoIap\/Onside['"].*$/m.test(content) ||
271
- /^\s*pod\s+['"]OnsideKit['"].*$/m.test(content)
272
- ) {
273
- return content;
274
- }
275
-
276
- const targetMatch = content.match(/target\s+'[^']+'\s+do\s*\n/);
277
- if (!targetMatch) {
278
- WarningAggregator.addWarningIOS(
279
- 'expo-iap',
280
- 'Could not find a target block in Podfile when adding OnsideKit; skipping installation.',
281
- );
266
+ // Set EXPO_IAP_ONSIDE env var at the top of the Podfile so that the ExpoIap podspec
267
+ // conditionally adds OnsideKit as a dependency. This makes #if canImport(OnsideKit)
268
+ // work inside ExpoIap's Swift source files.
269
+ if (content.includes("ENV['EXPO_IAP_ONSIDE'] = '1'")) {
282
270
  return content;
283
271
  }
284
272
 
285
- const podLine = ` pod 'OnsideKit'\n`;
286
- const insertIndex = targetMatch.index! + targetMatch[0].length;
287
-
288
- logOnce('📦 expo-iap: Added OnsideKit pod to Podfile');
273
+ logOnce('📦 expo-iap: Enabled OnsideKit (EXPO_IAP_ONSIDE=1)');
289
274
 
290
- return content.slice(0, insertIndex) + podLine + content.slice(insertIndex);
275
+ return `ENV['EXPO_IAP_ONSIDE'] = '1'\n` + content;
291
276
  };
292
277
 
293
278
  export type AutolinkState = {expoIap: boolean; onside: boolean};