Conversation
…e private header Five files carried their own copy of the __has_include chain that finds the mParticle and RoktContracts headers. They now import RNMPSDKImports.h, which tries CocoaPods, a manual xcframework, flat headers on the search path (for the upcoming opt-in Swift Package Manager mode), then a module import. The podspec is unchanged, and Podfile.lock is identical in the default CocoaPods mode. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview Replaces the repeated import blocks across Reviewed by Cursor Bugbot for commit 6676416. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The intended private header is exported publicly by the current CocoaPods specification.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Centralizes iOS SDK header resolution to prepare for Swift Package Manager support.
Changes:
- Adds shared fallback import logic.
- Replaces five duplicated import chains.
- Registers the header in the Xcode project.
| File | Description |
|---|---|
ios/RNMParticle/RNMPSDKImports.h |
Defines centralized SDK imports. |
ios/RNMParticle/RNMParticle.mm |
Uses shared imports. |
ios/RNMParticle/RNMPRokt.mm |
Uses shared imports. |
ios/RNMParticle/RoktEventManager.mm |
Uses shared imports. |
ios/RNMParticle/RoktLayoutManager.m |
Uses shared imports. |
ios/RNMParticle/RoktNativeLayoutComponentView.h |
Uses shared imports. |
ios/RNMParticle.xcodeproj/project.pbxproj |
Registers the new header. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1,28 @@ | |||
| // Private: the mParticle and RoktContracts headers, for every way an app can supply the SDKs. | |||
There was a problem hiding this comment.
That is right for this PR on its own. #425, later in this stack, adds s.private_header_files = 'ios/**/*.h' to the podspec, which makes every implementation header private, this one included. The stack merges into workstation/spm-migration as a whole before anything reaches main, so the in-between state is never released.

Why
This package finds the mParticle and Rokt headers with a block of fallback rules that was copied, slightly differently, into five files. The next change in this series, an opt-in Swift Package Manager mode, needs one more rule, and adding it five times invites the copies to drift apart. Once this lands, the rules live in one place, and apps see no difference: the files compile against exactly the same headers as before.
Programme
Part of the plan to support Swift Package Manager in this package before the CocoaPods central repository becomes read-only on 2026-12-02 (CocoaPods announcement). This is the second of eight pull requests, all merging into the
workstation/spm-migrationbranch, which merges intomainonce the series is complete, and shipping together in one release; the plan record is internal and cannot be linked here.What changes
Before:
RNMParticle.mm,RNMPRokt.mm,RoktEventManager.mm,RoktLayoutManager.mandRoktNativeLayoutComponentView.heach had their own__has_includechain, andRoktLayoutManager.malso used@import RoktContracts.After: they all
#import "RNMPSDKImports.h", which tries, in order:<mParticle_Apple_SDK_ObjC/…>and<RoktContracts/RoktContracts-Swift.h>;<mParticle_Apple_SDK/…>and<RoktContracts/RoktContracts.h>;"mParticle.h","RoktContracts-Swift.h"), which the next pull request uses;.mfiles only.The podspec is unchanged. The header is also listed in
ios/RNMParticle.xcodeproj, the way the placeholder registry files were. No documentation change is needed.Linked work
Depends on: the previous pull request in this series, which adds the debug-build duplicate-SDK warning (branch
thomson-t/spm-01-duplicate-sdk-warning); merge that first.Unblocks: the opt-in Swift Package Manager mode (branch
thomson-t/spm-03-spm-core-mode).Rollout
Path: this merges into
workstation/spm-migration, notmain, so nothing reachesmainor a release until the whole series has merged there and that branch is merged intomain. It then ships in the next release.Feature flags: none.
Turning it off: a published version cannot be recalled. Reverting this pull request and releasing again restores the per-file blocks in the next version.
What we watch: this repository's issues and CI, for header-not-found build errors in any integration mode.
Risks
Podfile.lockand a passing build, archive and test run; we would see "file not found" build errors reported against that release.RNMParticle.mmnow also sees the Rokt headers); contained because these are the same public SDK headers the package already depends on, and nothing is redeclared; we would see a duplicate-declaration build error.Risk class: low.
Who
Written by: an automated coding agent (Claude Code), at an engineer's request, following the internal Swift Package Manager migration plan.
Code reviewed before opening: an independent review agent reviewed the change before it was committed.
Design reviewed before opening: the requesting engineer approved the migration plan, which specifies this header and its branch order.
Decision this implements: the requesting engineer's approval of the migration plan on 2026-09-28; the record is internal and cannot be linked.
Checked: on 2026-09-28, with Xcode 27.0 on an iOS 26.5 simulator, the sample app (React Native 0.84, New Architecture) in its default CocoaPods mode:
pod installgave an identicalPodfile.lock;Not checked: the Old Architecture; tvOS; a manually embedded xcframework. CI, which builds with Xcode 16, passed on this pull request.
Size
Hand-written: 35 lines added and 48 removed in 7 files.
Generated: none.
🤖 Generated with Claude Code