fix: App Inbox signatures and type/action fallback#141
Open
steve228uk wants to merge 2 commits into
Open
Conversation
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.
Summary
toMessageItemAction()on Android to fall back to the"action"key when"type"is absent from an App Inbox action payload.appInboxMessageToDictionary:andappInboxActionToDictionary:helper methods toExponea.mmfor converting TurboModule typed structs toNSDictionary.markAppInboxAsRead,trackAppInboxOpened,trackAppInboxOpenedWithoutTrackingConsent,trackAppInboxClick,trackAppInboxClickWithoutTrackingConsent) fromNSDictionary *to typedJS::NativeExponeastruct references.markAppInboxAsReadon both platforms to resolve the native App Inbox item by message ID before marking it read.Issues Resolved
App Inbox action tracking failed silently when Android payloads carried the action type under
"action"rather than"type".On iOS, TurboModule typed structs were being passed where
NSDictionary *was expected, causing New Architecture / TurboModule compile failures.For
markAppInboxAsRead, reconstructing/parsing the message from the React Native payload was brittle. The native SDK expects its own App Inbox message model, so this now fetches the native item by ID before marking it read.How
toMessageItemAction()reads"type"first and falls back to"action", so both payload key names resolve toMessageItemAction.Type.markAppInboxAsRead()converts the typed React Native payload to a message ID, fetches the native App Inbox item, and only resolves when the native mark-as-read call succeeds.JS::NativeExponea::AppInboxMessageandJS::NativeExponea::AppInboxActionstructs to dictionaries before calling the existing bridge tracking methods.markAppInboxAsRead()now passes the typed message ID into an async bridge method that fetches the native App Inbox item, marks it read, and propagates success or failure through the Promise.Validation
git diff --checkyarn typecheckwas not run locally because this checkout does not currently have a Yarnnode_modulesstate file; running it requiresyarn installfirst.