feat: migrate Rokt kit to Rokt SDK 5.x and remove MpRoktEventCallback#704
feat: migrate Rokt kit to Rokt SDK 5.x and remove MpRoktEventCallback#704jamesnrokt wants to merge 3 commits into
Conversation
Bumps com.rokt:roktsdk 4.14.0 → 5.1.0 and adopts the 5.x event-driven API: - Rokt.execute(...) → Rokt.selectPlacements(...) - RoktEvent.id renamed to identifier; SDK-side CartItemInstantPurchase.placementId renamed to identifier - com.rokt.roktsdk.RoktLayout switched to onEvent: (RoktEvent) -> Unit - Drops removed Rokt.RoktCallback / Rokt.RoktInitCallback / Rokt.UnloadReasons and RoktWidgetDimensionCallBack.onMarginChanged Removes the legacy callback surface from the mParticle public API, since 5.x customers consume Rokt.events(identifier): Flow<RoktEvent> instead: - Delete MpRoktEventCallback and UnloadReasons - Drop callbacks param from com.mparticle.Rokt.selectPlacements - Drop mpRoktEventCallback from RoktKitApi, RoktKitApiImpl, KitIntegration.RoktListener, and RoktKit.selectPlacements - Rename RoktKit.runComposableWithCallback to prepareComposableAttributes; RoktLayout composable no longer takes a callback parameter BREAKING CHANGE: MpRoktEventCallback and UnloadReasons are removed and the callbacks parameter has been dropped from Rokt.selectPlacements and the mParticle RoktLayout composable. Use Rokt.events(identifier) to observe placement events as a Flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR SummaryHigh Risk Overview Removes the legacy callback-based API ( Aligns naming and signatures with Rokt 5.x (e.g., Reviewed by Cursor Bugbot for commit a81dddc. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1e4e35. Configure here.
Renames public API symbols to match Rokt 5.x's vocabulary: - com.mparticle.RoktEvent.*.placementId → identifier on all event classes (OfferEngagement, PositiveEngagement, FirstPositiveEngagement, PlacementInteractive, PlacementReady, PlacementClosed, PlacementCompleted, PlacementFailure, OpenUrl, CartItemInstantPurchase) - Rokt.purchaseFinalized(placementId, ..., status) → (identifier, ..., success); propagated through RoktKitApi, RoktKitApiImpl, KitIntegration.RoktListener, and RoktKit Rename-only — no behavior change. BREAKING CHANGE: RoktEvent.placementId is renamed to identifier and Rokt.purchaseFinalized parameters renamed from (placementId, status) to (identifier, success). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rokt SDK 5.x removed onMarginChanged from RoktWidgetDimensionCallBack; the kit already dropped its override, but mParticle's mirror interface still forced customers to implement an onMarginChanged that never fires. onHeightChanged remains the only method on RoktLayoutDimensionCallBack and is still the way to observe Widget height changes — 5.x exposes no event-based equivalent. BREAKING CHANGE: RoktLayoutDimensionCallBack.onMarginChanged is removed. Customers implementing this interface should drop the override. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
denischilik
left a comment
There was a problem hiding this comment.
The types were moved from mParticle to Rokt Kit. I would suggest merging this PR first: #700




Background
mParticle Android SDK 6.0 adopts Rokt Android SDK 5.x. The 5.x release consolidates the legacy
RoktCallback/RoktInitCallback/UnloadReasonscallbacks behind a single event-drivenFlow<RoktEvent>surface and removes several APIs the kit relied on (Rokt.execute,RoktWidgetDimensionCallBack.onMarginChanged, etc.). See Rokt's upstreamMIGRATING.mdfor the full guide.What Has Changed
Rokt SDK 5.x adoption (kit only):
com.rokt:roktsdkbumped4.14.0→5.1.0.Rokt.execute(...)replaced withRokt.selectPlacements(...).RoktEvent.idfield renamed toRoktEvent.identifier; SDK-sideCartItemInstantPurchase.placementId→identifier.com.rokt.roktsdk.RoktLayoutinvocation switched to the newonEvent: (RoktEvent) -> Unitsignature.Rokt.RoktCallback,Rokt.RoktInitCallback,Rokt.UnloadReasons, andRoktWidgetDimensionCallBack.onMarginChanged(all removed in 5.x).mParticle public-API cleanup (breaking):
com.mparticle.MpRoktEventCallbackandcom.mparticle.UnloadReasons. Customers should consumeRokt.events(identifier): Flow<RoktEvent>instead.callbacks: MpRoktEventCallback?parameter fromcom.mparticle.Rokt.selectPlacements.mpRoktEventCallbackfromRoktKitApi.selectPlacements,RoktKitApiImpl.selectPlacements,KitIntegration.RoktListener.selectPlacements, andRoktKit.selectPlacements.RoktKit.runComposableWithCallbackrenamed toprepareComposableAttributes; the mParticleRoktLayoutcomposable no longer takes a callback param.mParticle naming alignment with Rokt 5.x (breaking):
com.mparticle.RoktEvent.*.placementIdrenamed toidentifieron every event class (including the named param onCartItemInstantPurchase).Rokt.purchaseFinalized(placementId, …, status)renamed to(identifier, …, success); propagated throughRoktKitApi,RoktKitApiImpl,KitIntegration.RoktListener, andRoktKit.Screenshots/Video
N/A
Checklist