Skip to content

fix: App Inbox signatures and type/action fallback#141

Open
steve228uk wants to merge 2 commits into
exponea:mainfrom
steve228uk:fix/signatures
Open

fix: App Inbox signatures and type/action fallback#141
steve228uk wants to merge 2 commits into
exponea:mainfrom
steve228uk:fix/signatures

Conversation

@steve228uk
Copy link
Copy Markdown

@steve228uk steve228uk commented May 14, 2026

Summary

  • Updates toMessageItemAction() on Android to fall back to the "action" key when "type" is absent from an App Inbox action payload.
  • Adds appInboxMessageToDictionary: and appInboxActionToDictionary: helper methods to Exponea.mm for converting TurboModule typed structs to NSDictionary.
  • Updates the App Inbox method signatures on iOS (markAppInboxAsRead, trackAppInboxOpened, trackAppInboxOpenedWithoutTrackingConsent, trackAppInboxClick, trackAppInboxClickWithoutTrackingConsent) from NSDictionary * to typed JS::NativeExponea struct references.
  • Updates markAppInboxAsRead on 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

  • Android: toMessageItemAction() reads "type" first and falls back to "action", so both payload key names resolve to MessageItemAction.Type.
  • Android: 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.
  • iOS: Private helpers convert codegen-generated JS::NativeExponea::AppInboxMessage and JS::NativeExponea::AppInboxAction structs to dictionaries before calling the existing bridge tracking methods.
  • iOS: 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 --check

yarn typecheck was not run locally because this checkout does not currently have a Yarn node_modules state file; running it requires yarn install first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant