From bd8a6a6f554d9754c598a4a5bd842d9722724ca9 Mon Sep 17 00:00:00 2001 From: Thomson Thomas Date: Mon, 26 Oct 2026 16:04:11 -0400 Subject: [PATCH] fix(ios): default the Swift Package Manager core SDK to 9.7.4 In Swift Package Manager mode, pod install pins the mParticle core SDK, and every kit given without a version, to DEFAULT_CORE_VERSION exactly. At 9.6.1, the Rokt kit logs its placement analytics event with the attributes prepared for Rokt as custom attributes, including the user's filtered identities and MPID. The core forwards that event to every other configured kit. mparticle-apple-sdk 9.7.4 logs it with none (mParticle/mparticle-apple-sdk#1126), as the kit's README documents. The range in Package.swift does not cover this: it applies only to React Native's experimental Swift Package Manager mode. CocoaPods mode already resolves 9.7.4 from its range. The core and Rokt kit Package.swift files are unchanged between the two versions, and every kit in ios/mparticle_spm_kits.json has a v9.7.4 tag. The README examples move to the new default. Co-Authored-By: Claude Opus 5.5 (1M context) --- README.md | 6 +++--- ios/mparticle_spm.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cef3652..c8616e2 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ List your kits by CocoaPods name at the top of `ios/Podfile`, before any `target $RNMParticleSPMKits = ['mParticle-Rokt'] ``` -Then run `bundle exec pod install`. It prints each Swift package it links, such as `[mParticle] MyApp <- mParticle-Rokt 9.6.1`; commit the `.xcodeproj` change and `Package.resolved`. Every CocoaPods linkage works, and no `pre_install` hook is needed. To take the SDKs from CocoaPods instead, see [CocoaPods (deprecated)](#cocoapods-deprecated). +Then run `bundle exec pod install`. It prints each Swift package it links, such as `[mParticle] MyApp <- mParticle-Rokt 9.7.4`; commit the `.xcodeproj` change and `Package.resolved`. Every CocoaPods linkage works, and no `pre_install` hook is needed. To take the SDKs from CocoaPods instead, see [CocoaPods (deprecated)](#cocoapods-deprecated). 3. Import and start the mParticle Apple SDK into Swift or Objective-C. @@ -342,13 +342,13 @@ Every mParticle and Rokt SDK must come from Swift Package Manager, and none from ```ruby $RNMParticleSPMKits = ['mParticle-Rokt', 'mParticle-Braze-14'] -$RNMParticleSPMCoreVersion = '9.6.1' +$RNMParticleSPMCoreVersion = '9.7.4' ``` - `$RNMParticleSPMKits` lists kits by CocoaPods name. [`ios/mparticle_spm_kits.json`](./ios/mparticle_spm_kits.json) maps every kit of the mParticle Apple SDK to its Swift package, including `mParticle-Kochava-9` and `mParticle-Kochava-No-Tracking-9`, which ship only as Swift packages, and `RoktSDKPlus`, which already includes `mParticle-Rokt` and is supported only from Swift Package Manager. For any other kit, give `{ url: '…', product: '…', version: '…' }`. - `$RNMParticleSPMCoreVersion` pins the core SDK. It defaults to the version this release was tested with. A kit without a version gets the core's, since mParticle kits are released with the core. -**What `pod install` changes.** On each `pod install`, this package edits your app's `.xcodeproj`: it adds a Swift package reference for the core SDK and each kit, pinned to the exact version, and links each package's product into every iOS application target that uses this package. It unlinks every kit from `ios/mparticle_spm_kits.json` that `$RNMParticleSPMKits` does not list, including one you added by hand or switched to another major version, and removes its package reference once no target links it. It never removes or replaces a package from any other URL, such as a kit you gave by `url:`: remove that in Xcode. It prints every change (`[mParticle] MyApp <- mParticle-Rokt 9.6.1`), and running it again changes nothing. It stops `pod install` with an error if a pod would add a second copy of the SDKs. Commit the `.xcodeproj` change and `ios/.xcworkspace/xcshareddata/swiftpm/Package.resolved`, so every build resolves the same versions. +**What `pod install` changes.** On each `pod install`, this package edits your app's `.xcodeproj`: it adds a Swift package reference for the core SDK and each kit, pinned to the exact version, and links each package's product into every iOS application target that uses this package. It unlinks every kit from `ios/mparticle_spm_kits.json` that `$RNMParticleSPMKits` does not list, including one you added by hand or switched to another major version, and removes its package reference once no target links it. It never removes or replaces a package from any other URL, such as a kit you gave by `url:`: remove that in Xcode. It prints every change (`[mParticle] MyApp <- mParticle-Rokt 9.7.4`), and running it again changes nothing. It stops `pod install` with an error if a pod would add a second copy of the SDKs. Commit the `.xcodeproj` change and `ios/.xcworkspace/xcshareddata/swiftpm/Package.resolved`, so every build resolves the same versions. **Linkage.** This package's pod is always built as a static framework, so it works with each CocoaPods linkage: diff --git a/ios/mparticle_spm.rb b/ios/mparticle_spm.rb index 95c1dfd..2c667b4 100644 --- a/ios/mparticle_spm.rb +++ b/ios/mparticle_spm.rb @@ -7,7 +7,7 @@ # # $RNMParticleSPMKits = ['mParticle-Rokt'] # kits by pod name, from ios/mparticle_spm_kits.json, # # or { url:, product:, version: } for any other kit -# $RNMParticleSPMCoreVersion = '9.6.1' # exact core SDK version; kits without one get it too +# $RNMParticleSPMCoreVersion = '9.7.4' # exact core SDK version; kits without one get it too # $RNMParticleDisableSPM = true # take the SDKs from CocoaPods instead # # On each `pod install` in this mode: @@ -28,7 +28,7 @@ module MParticleSPM CORE_URL = 'https://github.com/mParticle/mparticle-apple-sdk'.freeze CORE_PRODUCT = 'mParticle-Apple-SDK'.freeze # Default core version when the Podfile sets none. Bump with each tested native release. - DEFAULT_CORE_VERSION = '9.6.1'.freeze + DEFAULT_CORE_VERSION = '9.7.4'.freeze # Kits by their CocoaPods name. The Expo config plugin reads the same file. KITS = JSON.parse(File.read(File.join(__dir__, 'mparticle_spm_kits.json')))['kits'].freeze # Packages this file unlinks when the Podfile does not list them. A package from any other URL, such