feat: report inbox action clicks automatically - #50
Merged
Conversation
An action carries its own tracking id in `data['trackingId']`, separate from the message's click tracking id, so a click can be attributed to the button the user actually pressed rather than to the message as a whole. Nothing was reading it, so pressing an action button recorded no click. CourierInbox now reports the click when an action is pressed, and `InboxAction.markAsClicked(messageId)` exposes the same thing for apps that build their own action buttons. An action from a template that opted out of tracking arrives without an id and is a no-op. Adds an `inbox.click_message_action` channel method backed by the existing `client.inbox.click` on both platforms. Mirrors the convention already in the Android SDK. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cuts a patch release so the action click tracking in this branch ships. Co-Authored-By: Claude Opus 5 (1M context) <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
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.
What
An inbox action carries its own tracking id in
data['trackingId'], separate from the message's click tracking id. It lets a click be attributed to the button the user actually pressed rather than to the message as a whole. Nothing in this SDK was reading it, so pressing an action button recorded no click at all.Changes
CourierInboxreports the click when an action is pressed, so tracking does not depend on the integrator remembering to do it.InboxAction.markAsClicked(messageId)exposes the same thing for apps that build their own action buttons, alongside anInboxAction.trackingIdgetter.inbox.click_message_actionchannel method, backed by the existingclient.inbox.clickon both platforms — no new native SDK surface required.An action from a template that opted out of tracking arrives without an id, so both paths are a no-op.
Why this shape
Mirrors the convention already shipped in the Android SDK, where
InboxAction.markAsClicked(messageId)readsdata["trackingId"]and callsclient.inbox.click. The same API is being added to iOS and React Native, and the equivalent has landed in the web SDK.Verification
flutter analyze— no errors inlib/. The only errors reported are pre-existing, inexample/integration_test/, from the gitignoredenv.dart.🤖 Generated with Claude Code