Skip to content

Commit a36c517

Browse files
Add MIGRATING.md update
1 parent 93f8df0 commit a36c517

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

MIGRATING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,64 @@ This change only affects users who:
9393

9494
The `MPListenerController` class has been removed. The SDK no longer invokes any listener callbacks.
9595

96+
---
97+
98+
### Source-Based Distribution Changes
99+
100+
As part of the transition from binary (XCFramework) to source-based distribution, several public Swift classes have been converted to Objective-C. This improves compatibility with Swift Package Manager and reduces integration complexity, but may require code changes for Swift users who were referencing Swift-specific type hierarchies.
101+
102+
#### MPRoktEvent Classes Moved to Top-Level
103+
104+
The `MPRoktEvent` subclasses have been converted from Swift nested classes to Objective-C top-level classes. This changes how Swift users reference these types.
105+
106+
**Before (Swift):**
107+
108+
```swift
109+
let initEvent = MPRoktEvent.MPRoktInitComplete(success: true)
110+
let readyEvent = MPRoktEvent.MPRoktPlacementReady(placementId: "abc")
111+
let purchaseEvent = MPRoktEvent.MPRoktCartItemInstantPurchase(...)
112+
```
113+
114+
**After (Swift):**
115+
116+
```swift
117+
let initEvent = MPRoktInitComplete(success: true)
118+
let readyEvent = MPRoktPlacementReady(placementId: "abc")
119+
let purchaseEvent = MPRoktCartItemInstantPurchase(...)
120+
```
121+
122+
**Affected Classes:**
123+
124+
| Before (Swift) | After (Swift) |
125+
| ------------------------------------------- | ------------------------------- |
126+
| `MPRoktEvent.MPRoktInitComplete` | `MPRoktInitComplete` |
127+
| `MPRoktEvent.MPRoktShowLoadingIndicator` | `MPRoktShowLoadingIndicator` |
128+
| `MPRoktEvent.MPRoktHideLoadingIndicator` | `MPRoktHideLoadingIndicator` |
129+
| `MPRoktEvent.MPRoktPlacementInteractive` | `MPRoktPlacementInteractive` |
130+
| `MPRoktEvent.MPRoktPlacementReady` | `MPRoktPlacementReady` |
131+
| `MPRoktEvent.MPRoktOfferEngagement` | `MPRoktOfferEngagement` |
132+
| `MPRoktEvent.MPRoktOpenUrl` | `MPRoktOpenUrl` |
133+
| `MPRoktEvent.MPRoktPositiveEngagement` | `MPRoktPositiveEngagement` |
134+
| `MPRoktEvent.MPRoktPlacementClosed` | `MPRoktPlacementClosed` |
135+
| `MPRoktEvent.MPRoktPlacementCompleted` | `MPRoktPlacementCompleted` |
136+
| `MPRoktEvent.MPRoktPlacementFailure` | `MPRoktPlacementFailure` |
137+
| `MPRoktEvent.MPRoktFirstPositiveEngagement` | `MPRoktFirstPositiveEngagement` |
138+
| `MPRoktEvent.MPRoktCartItemInstantPurchase` | `MPRoktCartItemInstantPurchase` |
139+
140+
**Migration Steps:**
141+
142+
1. Find all usages of `MPRoktEvent.MPRokt*` in your Swift code
143+
2. Remove the `MPRoktEvent.` prefix
144+
3. Type checking with `is` remains unchanged since they still inherit from `MPRoktEvent`
145+
146+
**Notes:**
147+
148+
- Objective-C users are not affected by this change
149+
- The `MPRoktEvent` base class still exists and can be used for type checking
150+
- All initializers and properties remain the same
151+
152+
---
153+
96154
### Direct Routing Enabled by Default
97155

98156
API requests now route directly to regional endpoints based on your API key prefix:

0 commit comments

Comments
 (0)