Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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/<App>.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/<App>.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:

Expand Down
4 changes: 2 additions & 2 deletions ios/mparticle_spm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading