feat: Add callback support#22
Merged
Mansi-mParticle merged 2 commits intoMay 12, 2025
Merged
Conversation
rmi22186
reviewed
May 12, 2025
Comment on lines
+193
to
+203
| mpRoktEventCallback?.onUnload( | ||
| when (reason) { | ||
| Rokt.UnloadReasons.NO_OFFERS -> MParticle.UnloadReasons.NO_OFFERS | ||
| Rokt.UnloadReasons.FINISHED -> MParticle.UnloadReasons.FINISHED | ||
| Rokt.UnloadReasons.TIMEOUT -> MParticle.UnloadReasons.TIMEOUT | ||
| Rokt.UnloadReasons.NETWORK_ERROR -> MParticle.UnloadReasons.NETWORK_ERROR | ||
| Rokt.UnloadReasons.NO_WIDGET -> MParticle.UnloadReasons.NO_WIDGET | ||
| Rokt.UnloadReasons.INIT_FAILED -> MParticle.UnloadReasons.INIT_FAILED | ||
| Rokt.UnloadReasons.UNKNOWN_PLACEHOLDER -> MParticle.UnloadReasons.UNKNOWN_PLACEHOLDER | ||
| Rokt.UnloadReasons.UNKNOWN -> MParticle.UnloadReasons.UNKNOWN | ||
| } |
Collaborator
There was a problem hiding this comment.
This looks like it's missing from the iOS callback PR. Should we discuss? Looks like this code was added to android pr here, and I don't see an equivalent on iOS.
| onLoadCallback = onLoad | ||
| onShouldHideLoadingIndicatorCallback = onShouldHideLoadingIndicator | ||
| onShouldShowLoadingIndicatorCallback = onShouldShowLoadingIndicator | ||
| this.mpRoktEventCallback = mpRoktEventCallback |
Collaborator
There was a problem hiding this comment.
So I guess in Android you can't just pass in the code blocks like I do here?
Collaborator
There was a problem hiding this comment.
We talked about this on a call. Android seems to implement this callbacks in a protocol/delegate way while iOS passes around code blocks to achieve the same thing. Interesting difference on the Rokt side to note but we're doing things correctly for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instructions
developmentSummary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)