This guide walks you through testing the iOS static linkage changes and the new Expo config plugin.
Before starting, ensure you have the following installed:
# Check Node.js (v18+ recommended)
node --version
# Check Yarn
yarn --version
# Check Ruby (for CocoaPods)
ruby --version
# Check CocoaPods
pod --version
# Check Xcode CLI tools
xcode-select -pIf missing any, install them:
# Install Node.js via Homebrew
brew install node
# Install Yarn
npm install -g yarn
# Install CocoaPods
sudo gem install cocoapods
# Install Xcode CLI tools (if not installed)
xcode-select --installcd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdkyarn installyarn buildThis will:
- Build the React Native SDK with
react-native-builder-bob - Compile the Expo config plugin TypeScript to
plugin/build/
ls -la plugin/build/You should see:
index.js
index.d.ts
withIterableAutolinking.js
withIterableAutolinking.d.ts
withIterablePodfile.js
withIterablePodfile.d.ts
cd exampleyarn installcd ios
pod install --repo-update
cd ..Expected output: Pod installation completes without errors. Look for:
Iterable-iOS-SDKbeing installedIterable-React-Native-SDKbeing installed- No "transitive dependencies" errors
Option A: Using Yarn (recommended)
yarn iosOption B: Using Xcode
open ios/ReactNativeSdkExample.xcworkspaceThen in Xcode:
- Select a simulator (e.g., iPhone 15)
- Press
Cmd + Bto build - Press
Cmd + Rto run
The build should complete without these errors:
- ❌
'Iterable_React_Native_SDK-Swift.h' file not found - ❌
transitive dependencies include statically linked binaries - ❌ Duplicate pod declaration errors
If the app launches in the simulator, the fix is working.
# From the react-native-sdk root
cd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdk
yarn test:pluginExpected output: All tests pass:
PASS __tests__/plugin.test.ts
withIterableAutolinking
disableAutolinking
✓ should add @iterable/react-native-sdk to autolinking exclude list
✓ should preserve existing exclude entries
✓ should be idempotent - not duplicate entries
withIterablePodfile
ensureStaticLinkage
✓ should keep existing static linkage unchanged
✓ should convert dynamic linkage to static
✓ should convert bare use_frameworks! to static linkage
injectIterablePods
✓ should inject Iterable pods after use_expo_modules!
...
# Create a new directory for testing
cd /tmp
npx create-expo-app@latest iterable-expo-test --template blank
cd iterable-expo-test# Add the local SDK as a dependency
yarn add /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdkEdit app.json:
{
"expo": {
"name": "iterable-expo-test",
"slug": "iterable-expo-test",
"plugins": [
["@iterable/react-native-sdk", { "enableNotificationExtension": true }]
]
}
}npx expo prebuild --cleancat ios/PodfileVerify these entries exist:
-
Static linkage is set:
use_frameworks! :linkage => :static
-
Iterable pods with dynamic override:
# Iterable SDK (Expo Managed Workflow) pod 'Iterable-React-Native-SDK', :path => '../node_modules/@iterable/react-native-sdk', :linkage => :dynamic pod 'Iterable-iOS-SDK', :linkage => :dynamic
-
Notification extension target (if enabled):
target 'IterableNotifications' do use_frameworks! :linkage => :dynamic pod 'Iterable-iOS-AppExtensions' end
# Run prebuild again without --clean
npx expo prebuild
# Check for duplicates
grep -c "Iterable-React-Native-SDK" ios/PodfileExpected: Should output 1 (not duplicated)
npx expo run:ioscd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/iterable-swift-sdk# Check IterableSDK.h
grep -A2 "__cplusplus" swift-sdk/IterableSDK.hExpected output:
#ifdef __cplusplus
extern "C" {
#endif# Check IterableAppExtensions.h
grep -A2 "__cplusplus" notification-extension/IterableAppExtensions.hExpected output:
#ifdef __cplusplus
extern "C" {
#endifgrep "resource_bundles" Iterable-iOS-SDK.podspecExpected output:
s.resource_bundles = {'IterableSDKResources' => 'swift-sdk/Resources/**/*.{storyboard,xib,xcassets,xcdatamodeld}' }This means the C++ linkage fix isn't being picked up. Ensure:
- You're using the correct iOS SDK branch:
fix/SDK-290-Export-iOS-sdk-header-file - Run
pod cache clean --alland reinstall pods
cd ios
pod deintegrate
pod cache clean --all
pod install --repo-update# Rebuild the plugin
cd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdk
rm -rf plugin/build
yarn build:plugin# Install test dependencies
cd plugin
yarn add -D ts-jest @types/jest# Build everything
cd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdk
yarn install && yarn build
# Run plugin tests
yarn test:plugin
# Run example app
cd example && yarn ios
# Clean rebuild
yarn clean && yarn build
# Check git diff of your changes
cd /Users/joao.dordio/dev/repos/codereview/ReactNativeStatic/react-native-sdk
git diff --statYou've successfully tested the changes if:
- ✅
yarn buildcompletes without errors - ✅
yarn test:plugin- All tests pass - ✅ Example app builds and runs on iOS simulator
- ✅ No Swift header file not found errors
- ✅ Expo prebuild generates correct Podfile entries
- ✅ Running prebuild twice doesn't duplicate entries