feat: [SDK-5180] expose notification click event JSON - #2742
Merged
Conversation
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)2/2 touched executable lines covered (100.0% — requires ≥ 80%) |
abdulraqeeb33
approved these changes
Sep 9, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Approved.
Stay native for KMP. This serializer sits on Android org.json and Android-only notification fields (androidNotificationId, icons, LED, lock-screen visibility). :kmp is still logger-only, and there is no iOS sibling. Revisit when the notifications model itself moves.
One non-blocking follow-up: JSONObject(rawPayload) throws when rawPayload is empty (initPayloadData returns early if custom is missing). The existing catch then omits the key. Happy-path OneSignal clicks always have a valid payload string.
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.
Description
One Line Summary
Expose notification click events as JSON through the public Android SDK API.
Details
Motivation
NotificationClickEventalready had internal JSON serialization, butINotificationClickEventdid not expose it. Applications therefore received the default object identity when logging the event and had to duplicate serialization logic.Scope
toJSONObject()toINotificationClickEvent.notificationandresultevent shape.rawPayloadas a JSON object, including grouped notifications.actionkey toresultand the serializedrawPayloadtype from string to object.Testing
Unit testing
Added notification click serialization tests covering notification fields, grouped notifications, action ID, URL, nullable fields, and nested raw payload objects.
Manual testing
No device testing was performed. The targeted unit tests, Spotless checks, IDE lint diagnostics, and notifications release build passed.
Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor