Skip to main content

3.4.13 - OnsideKit Conditional Dependency

· 2 min read
Hyo
Expo IAP Maintainer

Expo IAP 3.4.13 fixes the OnsideKit integration to use a conditional dependency via ENV var, resolving CocoaPods resolution failures for all users.

Bug Fixes

OnsideKit Conditional Dependency via ENV var (#337)

The previous approaches for integrating OnsideKit — both as a subspec and as a separate pod entry — caused issues:

  • Subspec approach: CocoaPods resolves ALL subspecs during dependency analysis regardless of default_subspecs, causing pod install to fail with a deployment target mismatch (OnsideKit requires iOS 16.0+ but ExpoIap targets iOS 13.4).
  • Separate pod approach: Adding pod 'OnsideKit' to the Podfile without declaring it as an ExpoIap dependency meant #if canImport(OnsideKit) evaluated to false during ExpoIap compilation, so Onside code was compiled out.

New approach: The Expo plugin now prepends ENV['EXPO_IAP_ONSIDE'] = '1' to the Podfile when modules.onside is enabled. The ExpoIap podspec reads this ENV var and conditionally adds OnsideKit as a direct dependency:

# ExpoIap.podspec
if ENV['EXPO_IAP_ONSIDE'] == '1'
s.dependency 'OnsideKit'
end

This means:

  • onside: false (default) — No OnsideKit dependency, no impact on existing users
  • onside: true — OnsideKit added as a dependency of ExpoIap, #if canImport(OnsideKit) works correctly

Verified locally with both configurations: pod install and xcodebuild succeed in both cases.

Installation

# bun
bun add expo-iap@3.4.13

# npm
npm install expo-iap@3.4.13

# yarn
yarn add expo-iap@3.4.13

References