Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7d807c7
fix: Use Defensive Copy for ActiveKitsRegistry (#571)
BrandonStalnaker Feb 12, 2026
dcabc28
fix: Mitigate Thread-safety of DateFormatter (#574)
BrandonStalnaker Feb 12, 2026
1158683
fix: MPURLRequestBuilder build crash (#575)
jamesnrokt Feb 12, 2026
1915591
fix: app crash from [MPUpload description] (#572)
thomson-t Feb 12, 2026
335d2c3
fix: Thread-safe access to currentUser to prevent crash during kit re…
thomson-t Feb 12, 2026
7a89b79
fix: Add Brackets Thread Safety Tests (#573)
BrandonStalnaker Feb 13, 2026
0e7ab34
fix: background expiration race (#577)
nickolas-dimitrakas Feb 13, 2026
0ca8746
fix: Guarantee UserDefaults Thread Safety (#580)
BrandonStalnaker Feb 13, 2026
90726e9
fix: App crash when JSON serialization of upload dictionary (#579)
thomson-t Feb 13, 2026
47fbe33
fix: Add Try/Catch to File Write (#581)
BrandonStalnaker Feb 13, 2026
1aa67cd
chore: Cleanup Release Actions (#570)
BrandonStalnaker Feb 13, 2026
1a1b676
fix: Potential MPURLRequestBuilder crash (#578)
jamesnrokt Feb 13, 2026
65623b9
fix: endSessionIfTimedOut race condition (#582)
nickolas-dimitrakas Feb 13, 2026
181399b
fix: PreferredLanguages may be empty (#583)
denischilik Feb 16, 2026
0eb5fb5
fix: MPNetworkCommunication background task (#584)
jamesnrokt Feb 16, 2026
0a48dfd
test: fix endSessionIfTimedOut failing tests (#585)
nickolas-dimitrakas Feb 16, 2026
3318057
ci: Reorder S3 upload to after branch push in release workflow (#586)
BrandonStalnaker Feb 16, 2026
544c18f
chore: Release v8.43.1 (#588)
mparticle-automation Feb 16, 2026
4995b0d
chore: Add AGENTS file (#590)
jamesnrokt Feb 17, 2026
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
16 changes: 1 addition & 15 deletions .github/workflows/sdk-release-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,8 @@ jobs:
echo "Updated Package.swift:"
head -15 Package.swift

- name: Upload xcframeworks to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.MP_IOS_SDK_S3_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MP_IOS_SDK_S3_SECRET }}
AWS_DEFAULT_REGION: ${{ secrets.MP_IOS_SDK_S3_REGION }}
run: |
aws s3 cp mParticle_Apple_SDK.xcframework.zip s3://static.mparticle.com/sdk/ios/v${VERSION}/mParticle_Apple_SDK.xcframework.zip

echo "Uploaded xcframeworks to S3:"
echo " - s3://static.mparticle.com/sdk/ios/v${VERSION}/mParticle_Apple_SDK.xcframework.zip"

- name: Commit version changes
run: |
# trunk format the files before committing
trunk fmt
# Only add the version-related files, exclude build artifacts
git add \
CHANGELOG.md \
Expand Down Expand Up @@ -337,5 +324,4 @@ jobs:
--base main \
--head chore/release-v${VERSION} \
--title "chore: Release v${VERSION}" \
--body "$PR_BODY" \
--reviewer mParticle/sdk-team
--body "$PR_BODY"
2 changes: 1 addition & 1 deletion .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: iOS SDK Release
name: iOS SDK Release (Deprecated)

on:
workflow_dispatch:
Expand Down
162 changes: 162 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# AGENTS.md

## About mParticle SDKs

mParticle is a Customer Data Platform that collects, validates, and forwards event data to analytics and marketing integrations. The SDK is responsible for:

- **Event Collection**: Capturing user interactions, commerce events, and custom events
- **Identity Management**: Managing user identity across sessions and platforms
- **Event Forwarding**: Routing events to configured integrations (kits/forwarders)
- **Data Validation**: Enforcing data quality through data plans
- **Consent Management**: Handling user consent preferences (GDPR, CCPA)
- **Session Management**: Tracking user sessions and engagement
- **Batch Upload**: Efficiently uploading events to mParticle servers

### Glossary of Terms

- **MPID (mParticle ID)**: Unique identifier for a user across sessions and devices
- **Kit/Forwarder**: Third-party integration (e.g., Google Analytics, Braze) that receives events from the SDK
- **Data Plan**: Validation schema that defines expected events and their attributes
- **Workspace**: A customer's mParticle environment (identified by API key)
- **Batch**: Collection of events grouped together for efficient server upload
- **Identity Request**: API call to identify, login, logout, or modify a user's identity
- **Session**: Period of user activity with automatic timeout (typically 30 minutes)
- **Consent State**: User's privacy preferences (GDPR, CCPA) that control data collection and forwarding
- **User Attributes**: Key-value pairs describing user properties (e.g., email, age, preferences)
- **Custom Events**: Application-specific events defined by the developer
- **Commerce Events**: Predefined events for e-commerce tracking (purchases, product views, etc.)
- **Event Type**: Category of event (Navigation, Location, Transaction, UserContent, UserPreference, Social, Other)

## Role for agents

You are a senior iOS SDK engineer specializing in customer data platform (CDP) SDK development.

- Treat this as a **public SDK / framework** (distributed via SPM, and CocoaPods), not a full consumer app.
- Prioritize: API stability, minimal footprint, backward compatibility (iOS 15.6+, tvOS 15.6+), thread-safety, privacy compliance.
- The SDK handles event tracking, identity management, consent, commerce events, push notifications, and integration kits.
- Avoid proposing big refactors unless explicitly asked; prefer additive changes + deprecations.

## Quick Start for Agents

- Open the Xcode project/workspace with Xcode 16.4+.
- Primary actions:
- Build: via Xcode scheme or `xcodebuild`.
- Run unit tests: `Rokt_WidgetTests/` or via Xcode (Command + U).
- Lint: `trunk check` (primary enforcement tool).
- Pod lint: `pod lib lint mParticle-Apple-SDK.podspec`.
- Size report: Check binary size impact via CI workflow.
- Always validate changes with the full sequence in "Code style, quality, and validation" below before proposing or committing.

## Strict Do's and Don'ts

### Always Do

- Maintain compatibility with mParticle's kit/integration ecosystem.
- Keep public API surface additive; deprecate instead of remove.
- Mark public APIs with thorough documentation (HeaderDoc for Obj-C, `///` for Swift).
- Ensure changes work on both iOS and tvOS targets.
- Run `trunk check` and unit tests before any commit.
- Measure & report size impact before proposing dependency or asset changes.
- Update `PrivacyInfo.xcprivacy` if data collection practices change.

### Never

- Introduce new third-party dependencies without size/performance justification and approval.
- Block the main thread (no synchronous network, heavy computation, etc.).
- Crash on bad input/network — always provide fallback / error callback.
- Touch CI configs (`.github/`), release scripts (`Scripts/`), or CI YAML without explicit request.
- Propose dropping iOS 15.6 / tvOS 15.6 support or raising min deployment target.
- Break kit/integration compatibility without explicit coordination.
- Modify vendored libraries in `Libraries/` without explicit request.

## When to Ask for Clarification

- Before adding any new dependency.
- Before dropping support for OS versions.
- Before making breaking API changes.
- When changes affect the kit/integration interface.
- When test failures suggest the original code may have had bugs.

## Project overview

- mParticle Apple SDK (Rokt fork): a comprehensive customer data platform SDK for iOS and tvOS written in Objective-C and Swift.
- Handles event tracking, user identity management, consent management, commerce events, push notification handling, and integration kit orchestration.
- Distributed via Swift Package Manager, CocoaPods, and Carthage.
- Integration kits (like the Rokt kit) plug into this SDK to forward events to third-party services.

## Key paths

- `mParticle-Apple-SDK/` — Main SDK source (40+ subdirectories).
- `Include/` — Public headers (46 files).
- `AppNotifications/` — Push notification handling.
- `Consent/` — Consent management.
- `Data Model/` — Core data structures.
- `Ecommerce/` — Commerce event handling.
- `Event/` — Event processing.
- `Identity/` — User identity management.
- `Kits/` — Integration kit infrastructure.
- `Network/` — Network communication.
- `Persistence/` — Data storage.
- `mParticle-Apple-SDK-Swift/` — Swift-only components.
- `UnitTests/` — Unit tests (ObjCTests, SwiftTests, Mocks).
- `IntegrationTests/` — Integration tests (Tuist + WireMock).
- `Example/` — Sample app (11 subdirectories).
- `Scripts/` — Build, release, and utility scripts.
- `release.sh`, `xcframework.sh`, `carthage.sh`, `check_coverage.sh`.
- `Package.swift` — SPM manifest (swift-tools-version 5.5).
- `mParticle-Apple-SDK.podspec` — CocoaPods spec (v8.41.1).
- `PrivacyInfo.xcprivacy` — iOS privacy manifest.
- `ARCHITECTURE.md` — Architecture documentation with sequence diagrams.
- `CHANGELOG.md` — Release notes (extensive).
- `MIGRATING.md` — Migration guides for older versions.
- `RELEASE.md` — Release process documentation.
- `CONTRIBUTING.md` — Contribution guidelines.

## Code style, quality, and validation

- **Lint & format tools**:
- SwiftFormat: configured in project.
- SwiftLint: configured in project.
- **Primary enforcement tool**: `trunk check` (via Trunk.io). If Trunk unavailable, fall back to `swiftformat .` && `swiftlint`.
- Important: Only add comments if absolutely necessary. If you're adding comments, review why the code is hard to reason with and rewrite that first.

- **Strict post-change validation rule (always follow this)**:
After **any** code change, refactor, or addition — even small ones — you **must** run the full validation sequence:
1. `trunk check` — to lint, format-check, and catch style/quality issues.
2. Build the SDK: via Xcode or `xcodebuild` for both iOS and tvOS.
3. Run unit tests: both Objective-C and Swift test suites in `UnitTests/`.
4. `pod lib lint mParticle-Apple-SDK.podspec` — verify CocoaPods spec is valid.
5. If change affects code, assets, or dependencies: check coverage via `Scripts/check_coverage.sh`.
- Only propose / commit changes if all steps pass cleanly.
- If `trunk check` suggests auto-fixes, apply them first and re-validate.
- Never bypass this — it's required to maintain SDK stability, footprint, and public API quality.

- **Style preferences**:
- Objective-C: follow Apple's Coding Guidelines for Cocoa.
- Swift: prefer `let` over `var`; use value types where possible.
- Write thorough documentation for all public APIs.
- Avoid force-unwraps in Swift; use proper error handling in Objective-C.

- **Testing expectations**:
- Unit tests in `UnitTests/ObjCTests/` and `UnitTests/SwiftTests/`.
- Mocks in `UnitTests/Mocks/`.
- Integration tests in `IntegrationTests/`.
- Code coverage tracked via `Scripts/check_coverage.sh`.
- After changes, always re-run affected tests + full suite if core/shared code is touched.

- **CHANGELOG.md maintenance**:
- For **substantial changes**, **always add a clear entry** to `CHANGELOG.md`.
- Use standard categories: `Added`, `Changed`, `Deprecated`, `Fixed`, `Removed`, `Security`.
- Keep entries concise and written in imperative mood.
- Update `CHANGELOG.md` **before** finalizing a change.
- Never auto-generate or hallucinate changelog entries — flag for human review.

## Pull request and branching

- Follow mParticle's standard PR and branching conventions.

## External Resources

- [mParticle Apple SDK Documentation](https://docs.mparticle.com/developers/sdk/ios/)
- [Rokt mParticle Integration Docs](https://docs.rokt.com/developers/integration-guides/rokt-ads/customer-data-platforms/mparticle/)
- [ARCHITECTURE.md](./ARCHITECTURE.md) — SDK architecture and sequence diagrams.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# [8.43.1](https://github.com/mParticle/mparticle-apple-sdk/compare/v8.42.2...v8.43.1) (2026-02-16)

### Bug Fixes

- fix: MPNetworkCommunication background task (#584) ([dfab795e](https://github.com/mParticle/mparticle-apple-sdk/commit/dfab795e2bd68b6eb51f5cb0e5bcf1f551ae1182))
- fix: PreferredLanguages may be empty (#583) ([5a538c3b](https://github.com/mParticle/mparticle-apple-sdk/commit/5a538c3b3fc67444b76b8e3e756ec3f520c1d23c))
- fix: endSessionIfTimedOut race condition (#582) ([b2eb508c](https://github.com/mParticle/mparticle-apple-sdk/commit/b2eb508c401c3b189f9f4abcb149066f5959cbea))
- fix: Potential MPURLRequestBuilder crash (#578) ([70c0076c](https://github.com/mParticle/mparticle-apple-sdk/commit/70c0076c3e4d0f32a1ff4c0ad9c5518d8a1a5fb8))
- fix: Add Try/Catch to File Write (#581) ([18045c9e](https://github.com/mParticle/mparticle-apple-sdk/commit/18045c9e32c1a01cb954e08dd9a5ee590e6eb096))
- fix: App crash when JSON serialization of upload dictionary (#579) ([a5e19600](https://github.com/mParticle/mparticle-apple-sdk/commit/a5e196005cbcda92889f4f032498646a5108b58e))
- fix: Guarantee UserDefaults Thread Safety (#580) ([7baa7b41](https://github.com/mParticle/mparticle-apple-sdk/commit/7baa7b41a3d38b7bbc5afa4364b948b5de09f6f3))
- fix: background expiration race (#577) ([9d97bd32](https://github.com/mParticle/mparticle-apple-sdk/commit/9d97bd32fee29e25cb748c1ade4af1c933fa949a))
- fix: Add Brackets Thread Safety Tests (#573) ([0d831cc5](https://github.com/mParticle/mparticle-apple-sdk/commit/0d831cc522c38834081483dce8428a1737ce8b1e))
- fix: Thread-safe access to currentUser to prevent crash during kit replay (#576) ([a3ba57e8](https://github.com/mParticle/mparticle-apple-sdk/commit/a3ba57e860c68552c2d6297f7b8deb04ac09fe95))
- fix: app crash from [MPUpload description] (#572) ([91c0c5d4](https://github.com/mParticle/mparticle-apple-sdk/commit/91c0c5d4880e064fcb07569283fddb886ce1eb33))
- fix: MPURLRequestBuilder build crash (#575) ([604afeef](https://github.com/mParticle/mparticle-apple-sdk/commit/604afeefdfe32e5c2785cc3404c64941fcfda847))
- fix: Mitigate Thread-safety of DateFormatter (#574) ([7b36691d](https://github.com/mParticle/mparticle-apple-sdk/commit/7b36691d5fb50739da8e17b76cdba127caefaa19))
- fix: Use Defensive Copy for ActiveKitsRegistry (#571) ([e5d5e273](https://github.com/mParticle/mparticle-apple-sdk/commit/e5d5e27313bd6445ff491590168ab9718f05b86e))

# [8.42.2](https://github.com/mParticle/mparticle-apple-sdk/compare/v8.42.1...v8.42.2) (2026-02-11)

### Features
Expand Down
2 changes: 1 addition & 1 deletion Framework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>8.42.2</string>
<string>8.43.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"tz": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"b": "arm64",
"p": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"p": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"b": "arm64",
"tz": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"b": "arm64",
"tz": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"b": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"b": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"b": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"p": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"bid": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"equalToJson": {
"client_sdk": {
"platform": "ios",
"sdk_version": "8.42.2",
"sdk_version": "8.43.1",
"sdk_vendor": "mparticle"
},
"environment": "development",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"bid": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"equalToJson": {
"client_sdk": {
"platform": "ios",
"sdk_version": "8.42.2",
"sdk_version": "8.43.1",
"sdk_vendor": "mparticle"
},
"environment": "development",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"tz": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"p": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"tz": "${json-unit.ignore}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"p": "arm64",
"b": "arm64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
"uitl": 60,
"oo": false,
"sdk": "8.42.2",
"sdk": "8.43.1",
"di": {
"tz": "${json-unit.ignore}",
"bid": "${json-unit.ignore}",
Expand Down
Loading
Loading