iOS Build Failure (example-app V3): SpikeSdk.swift incompatible with SpikeSDK v4.3.101 - Multiple deprecated methods
The react-native-spike-sdk npm package fails to build on iOS due to incompatibilities between the Swift code included in the package and the native SpikeSDK CocoaPod specified in its configuration.
The Swift bridge code (SpikeSdk.swift) uses methods that have been deprecated or have changed signatures in the native SDK, causing compilation errors.
Environment:
Platform: iOS
Package version: react-native-spike-sdk@4.3.153
Native SDK version: SpikeSDK@4.3.101 (specified in package.json iosVersion)
React Native version: 0.76.2
CocoaPods version: 1.16.2
Node version: 18+
Xcode version: 15.x
macOS version: Sonoma
Project: Official example project spike-sdk-examples/react-native-v3
Build Errors:
- disableHealthKitIntegration() is not async
- Unreachable catch block
- Deprecated type warnings
-
Build failure: Error: Failed to build ios project.
"xcodebuild" exited with error code '65'
Root Cause
The Swift code in ios/SpikeSdk.swift and ios/SpikeConnectionLogger.swift contains code that is incompatible with SpikeSDK v4.3.101:
- Methods that were async have become synchronous (or vice versa)
- Types like SpikeConnection and SpikeLogger have been deprecated
- Error handling patterns no longer match the SDK behavior
Steps to Reproduce
- Clone the official example repository: spike-sdk-examples/react-native-v3
- Install dependencies: yarn install
- Install pods: cd ios && pod install && cd ..
- Try to build: yarn ios
- Build fails with the errors listed above