You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(inbox): add the iOS Mobile Inbox bridge (MAGE-1140) - #513
Adds the iOS bridge for the Mobile Inbox (MAGE-1140): forwards the TypeScript API from #502 to MobileInbox and maps native failures to the stable INBOX_* codes.
Stack (each PR is based on the one before it; review and merge in order):
PR 2 of 5, based on #502. Retarget to feat/mobile-inbox once the PR below it merges.
Due Diligence
I have tested this on a simulator/emulator or a physical device, on iOS and Android (if applicable). (Not run on a device. The Swift file passed a parse check and was not compiled against the native inbox.)
I have adjusted or added new test cases to team test docs, if applicable.
I am confident these changes are implemented with feature parity across iOS and Android (if applicable). (Android is the next PR.)
Release/Versioning Considerations
Minor Contains changes to the public API.
This is planned work for an upcoming release.
Changelog / Code Overview
ios/KlaviyoBridge+Inbox.swift: fetchInboxPage with read and archive filters, fetchInboxUnreadCount, updateInboxMessageState and the change signal, all behind #if canImport(KlaviyoInbox). sentAt and receivedAt always cross as epoch milliseconds.
ios/KlaviyoReactNativeSdk.mm: the matching RCT_EXPORT_METHODs and the INBOX_AVAILABLE constant. invalidate() removes the native subscription on a reload.
Opt-in: Inbox is off by default and is left out unless KLAVIYO_INCLUDE_INBOX is exactly 'true'. This is the reverse of Forms and Location, which are included unless set to 'false'. The dependencies the podspec resolves are unchanged for every value of the flag.
Capture is separate: on iOS the pod alone captures nothing. The host's Notification Service Extension has to link KlaviyoInboxExtension and call KlaviyoInboxExtensionSDK.capture. That is host code, not part of this module.
Test Plan
Swift parses; the TypeScript suite is unaffected.
To try it: KLAVIYO_INCLUDE_INBOX=true pod install against a feat/mobile-inbox build of klaviyo-swift-sdk. configure-sdk.sh --inbox (PR 4) does this, but does not add KlaviyoFoundation or KlaviyoInboxCore, which the Podfile needs today.
Not run: an Xcode build, the example app, a device.
Risk Score: Medium, because the change adds iOS bridge methods and an event to the module's public surface, though it is opt-in and a revert removes it.
Adds Inbox fetch, unread-count, state-update, and change-handler methods, the klaviyo:inboxChanged event, and the INBOX_AVAILABLE constant to KlaviyoReactNativeSdk.mm, backed by KlaviyoBridge+Inbox.swift.
Adds the KlaviyoInbox podspec dependency only when KLAVIYO_INCLUDE_INBOX is exactly 'true'.
Swift passed only a parse check. No compile against KlaviyoInbox, Xcode build, example-app run, or TypeScript test run is reported.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Layers: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: d4a41b7a-bba7-493e-9788-a133c80a76f7
Commits
Reviewing files that changed from the base of the PR and between d443aa0 and 89ebd20.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The iOS SDK now conditionally links KlaviyoInbox and exposes Inbox availability, page fetching, unread counts, message-state updates, and inbox-change events through the React Native module.
Changes: iOS Mobile Inbox
Layer / File(s)
Summary
Inbox dependency and availability klaviyo-react-native-sdk.podspec, ios/KlaviyoBridge+Inbox.swift
The podspec includes KlaviyoInbox only when KLAVIYO_INCLUDE_INBOX is 'true'. The bridge exposes availability and stores the change-subscription task.
The bridge adds page and unread-count fetching, message-state updates, and change subscriptions. It maps errors and converts Inbox messages and destinations to bridge payloads.
React Native Inbox methods and events ios/KlaviyoReactNativeSdk.mm
The module exports Inbox availability, promise-based methods, and the klaviyo:inboxChanged event. It forwards operations to the bridge and dispatches change events on the main queue.
This change adds an opt-in iOS Mobile Inbox bridge that is off by default, so existing apps are unaffected unless they enable it at pod install time. No merge-blocking issue was found. It has not been compiled or run on a device, so a native build check is worthwhile before relying on it.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'feat(inbox): add the iOS Mobile Inbox bridge (MAGE-1140)' matches the main change. The changeset adds the iOS bridge for the Mobile Inbox (fetch, unread count, state updates, change registr…
Description check
The description covers the purpose (iOS bridge for Mobile Inbox, MAGE-1140), a changelog/code overview of both native files and the podspec opt-in gate, a test plan, and related tickets. It is well fi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title 'feat(inbox): add the iOS Mobile Inbox bridge (MAGE-1140)' matches the main change. The changeset adds the iOS bridge for the Mobile Inbox (fetch, unread count, state updates, change registration) in KlaviyoBridge+Inbox.swift and KlaviyoReactNativeSdk.mm, and the podspec gate. It is specific and concise, and follows a conventional commit style. The ticket ID is a minor addition but does not reduce clarity.
Full details: Description check
Explanation
The description covers the purpose (iOS bridge for Mobile Inbox, MAGE-1140), a changelog/code overview of both native files and the podspec opt-in gate, a test plan, and related tickets. It is well filled in and states what was and was not tested. The Due Diligence and Release sections are partly checked and include clear notes. Remaining gaps are minor: the 'team test docs' item is unchecked without explanation, and the Release section has no stated milestone label, though the template asks for one. The 'Changelog' section does not mention the Android counterpart beyond the stack list, which is acceptable.
Layers: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 70f66330-d1e4-4f75-a978-9a7f7f416090
Commits
Reviewing files that changed from the base of the PR and between 02d487b and 2e87f1b.
Files selected for processing: 3
ios/KlaviyoBridge+Inbox.swift
ios/KlaviyoReactNativeSdk.mm
klaviyo-react-native-sdk.podspec
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
Recent review details
Context from checks skipped due to timeout: 1
GitHub Check: CodeRabbit
Additional context used
Path-based instructions: 2
This is public SDK source code (TypeScript with Kotlin/Swift native modules).
CodeRabbit configuration file
Files:
ios/KlaviyoBridge+Inbox.swift
ios/KlaviyoReactNativeSdk.mm
Comment only on defects: correctness bugs, security risks, secret or PII exposure, data loss, or outage risk.
this only includes the first batch of functions on the API surface we agreed on. the later ones (clearAll, setMessageState (bulk)) come in the later PR
Forward fetchPage with read and archive filters, the unread count, message
state changes and the change signal from the React Native module to
MobileInbox, mapping a native failure to the stable INBOX_* codes the
TypeScript layer switches on.
The inbox is opt-in: the podspec only depends on KlaviyoInbox when
KLAVIYO_INCLUDE_INBOX=true, every call is guarded by canImport, and the
module exports INBOX_AVAILABLE so a build without it rejects with
INBOX_UNAVAILABLE.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Name the opt-in as include_inbox and say it is the reverse of Forms and
Location, which are included unless set to 'false'. The dependencies the
podspec resolves are unchanged for every value of KLAVIYO_INCLUDE_INBOX.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Native InboxMessage.sentAt is no longer optional, so the bridge sends it as an
epoch-millisecond number instead of falling back to NSNull.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
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.
Description
Adds the iOS bridge for the Mobile Inbox (MAGE-1140): forwards the TypeScript API from #502 to
MobileInboxand maps native failures to the stableINBOX_*codes.Stack (each PR is based on the one before it; review and merge in order):
configure-sdk.sh --inboxclearAllPR 2 of 5, based on #502. Retarget to
feat/mobile-inboxonce the PR below it merges.Due Diligence
Release/Versioning Considerations
MinorContains changes to the public API.Changelog / Code Overview
ios/KlaviyoBridge+Inbox.swift:fetchInboxPagewith read and archive filters,fetchInboxUnreadCount,updateInboxMessageStateand the change signal, all behind#if canImport(KlaviyoInbox).sentAtandreceivedAtalways cross as epoch milliseconds.ios/KlaviyoReactNativeSdk.mm: the matchingRCT_EXPORT_METHODs and theINBOX_AVAILABLEconstant.invalidate()removes the native subscription on a reload.KLAVIYO_INCLUDE_INBOXis exactly'true'. This is the reverse of Forms and Location, which are included unless set to'false'. The dependencies the podspec resolves are unchanged for every value of the flag.KlaviyoInboxExtensionand callKlaviyoInboxExtensionSDK.capture. That is host code, not part of this module.Test Plan
KLAVIYO_INCLUDE_INBOX=true pod installagainst afeat/mobile-inboxbuild of klaviyo-swift-sdk.configure-sdk.sh --inbox(PR 4) does this, but does not addKlaviyoFoundationorKlaviyoInboxCore, which the Podfile needs today.Related Issues/Tickets
MAGE-1140. Parent: MAGE-1138.
🤖 Generated with Claude Code
Risk Score: Medium, because the change adds iOS bridge methods and an event to the module's public surface, though it is opt-in and a revert removes it.
klaviyo:inboxChangedevent, and theINBOX_AVAILABLEconstant toKlaviyoReactNativeSdk.mm, backed byKlaviyoBridge+Inbox.swift.KlaviyoInboxpodspec dependency only whenKLAVIYO_INCLUDE_INBOXis exactly'true'.