Skill: Bare iOS Native Integration
Integrate bare RN XCFramework artifacts into native iOS host app and verify startup/runtime behavior.
Quick Command
ReactNativeBrownfield.shared.bundle = ReactNativeBundle
ReactNativeBrownfield.shared.startReactNative { print("React Native bundle loaded") }When to Use
- Consuming generated bare RN XCFrameworks in host iOS app
- Wiring runtime initialization for UIKit or SwiftUI entrypoints
Prerequisites
- bare-ios-xcframework-generation.md completed
- Artifacts available in package output (
ios/.brownfield/packageor.brownfield/ios/package) - Host app builds in Xcode
Agent-Assisted Verification
Use agent-device after the host build succeeds. Read the agent-device skill or CLI help when available before exact commands. If it is missing and verification needs it, install it through the environment's approved/trusted path or ask the user to install or enable it. Then open the host app, navigate to the RN surface, capture snapshots/screenshots, and collect logs for Debug and Release behavior.
Step-by-Step Instructions
Progress checklist:
- [ ] Link generated frameworks
- [ ] Initialize RN startup
- [ ] Render registered module
- [ ] Verify Debug and Release behavior- Link these frameworks into host app:
<framework_target_name>.xcframeworkReactBrownfield.xcframeworkhermesvm.xcframework(orhermes.xcframeworkfor older RN)
- In app startup:
import <framework_target_name>
ReactNativeBrownfield.shared.bundle = ReactNativeBundle
ReactNativeBrownfield.shared.startReactNative(onBundleLoaded: {
print("React Native bundle loaded")
}, launchOptions: launchOptions)- Render RN UI with JS-registered module name:
- UIKit:
ReactNativeViewController(moduleName: "<registered_module_name>") - SwiftUI:
ReactNativeView(moduleName: "<registered_module_name>")
- UIKit:
- Validate:
- Debug with Metro (
npx react-native start) - Release without Metro
- Agent-assisted device evidence, using
agent-devicewhen possible
- Debug with Metro (
Stop Conditions
Mark complete only if:
- host app builds in Debug and Release
- RN module renders in both configurations
If Failed
- Re-check startup order: set bundle -> start runtime -> create RN view/controller
- Re-check
moduleNamematchesAppRegistry.registerComponent - Re-link all required frameworks if Release cannot load JS
Canonical Docs
Common Pitfalls
- Missing
ReactNativeBrownfield.shared.bundle = ReactNativeBundle - Wrong module name compared to JS registration
- Linking only app XCFramework without brownfield/hermes frameworks
Related Skills
- bare-ios-xcframework-generation.md - Bare iOS artifact generation
- bare-quick-start.md - Bare setup prerequisites