Skip to content

fix: parse Android notification raw payload - #58

Open
fadi-george wants to merge 1 commit into
mainfrom
fadigeorge/fix-android-raw-payload
Open

fix: parse Android notification raw payload#58
fadi-george wants to merge 1 commit into
mainfrom
fadigeorge/fix-android-raw-payload

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Parse Android notification click rawPayload values into objects consistently with foreground notification events.

Details

Motivation

Android sends rawPayload across the Capacitor bridge as a JSON string. Click events previously forwarded the native notification directly, bypassing OSNotification parsing and exposing a string despite the public object type.

Scope

Normalizes click-event notifications through OSNotification. Foreground notification behavior and public APIs are unchanged.

Testing

Unit testing

Added coverage verifying click notifications are OSNotification instances and string payloads are parsed into objects.

Manual testing

Not manually device-tested. Automated source checks, 225 tests, and the package build pass.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george
fadi-george requested a review from a team September 4, 2026 22:11

@nan-li nan-li left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two small things, neither blocking:

  • Each item in groupedNotifications still has rawPayload as a string, since OSNotification copies that array without parsing it. This is pre-existing, but it may be worth fixing here or in a follow-up.
  • Since this wasn't device-tested, consider doing a tap on the Android demo and confirm rawPayload in the click handler

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.

2 participants