Skip to content

feat: [SDK-5161] expose notification metadata and improve demo coverage - #199

Open
fadi-george wants to merge 9 commits into
mainfrom
fadi/sdk-5161
Open

feat: [SDK-5161] expose notification metadata and improve demo coverage#199
fadi-george wants to merge 9 commits into
mainfrom
fadi/sdk-5161

Conversation

@fadi-george

@fadi-george fadi-george commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Expose complete action-button and raw notification payload data, and make the demos exercise OneSignal-managed Android grouping.

Details

Motivation

The native iOS SDK returns action-button icons as templateIcon or systemIcon, but the .NET conversion only read icon. The .NET notification model also omitted the native rawPayload exposed by Android and iOS.

For SDK-5128, Android 16 can automatically group otherwise ungrouped notifications. Tapping that system-generated summary may launch the app without OneSignal click data, so the demos need a deterministic OneSignal-managed group.

Scope

  • Add nullable TemplateIcon and SystemIcon properties to ActionButton while preserving Android Icon behavior.
  • Map iOS template and system icons through one shared action-button converter used by click and foreground-display events.
  • Add Notification.RawPayload as parsed key/value data on Android and iOS, including notifications nested under GroupedNotifications.
  • Preserve the existing public notification constructors and add raw-payload-aware overloads.
  • Bundle template-bookmark-icon.png and template-share-icon.png in the demo app and Notification Service Extension.
  • Add android_group: "demo-group" to every maintained demo that sends remote notifications: the main demo, no-location demo, and local-notification plugin demo.
  • Align demo notification and IAM event logging with the Capacitor demo, including full event output and foreground prevent/display examples.

Testing

Unit testing

No unit tests were added because the repository currently has no unit-test project or test runner. Native conversion requires platform notification objects, and grouping summary behavior requires device testing.

Build verification

  • OneSignalSDK.DotNet.Android builds with zero warnings and errors.
  • OneSignalSDK.DotNet.iOS builds with zero warnings and errors.
  • Main demo builds for Android and iOS.
  • No-location and local-notification plugin demos build for Android.
  • CSharpier formatting passes.

Manual testing

Action-button icons

Sent notifications with blank, template, and system action-button icons and verified:

  • Android: Icon contains the configured resource name when provided and is null when blank.
  • iOS template icon: TemplateIcon is populated; Icon and SystemIcon are null.
  • iOS system icon: SystemIcon is populated; Icon and TemplateIcon are null.
  • iOS blank icon: all icon properties are null.

Android grouping and raw payload

Sent multiple demo notifications using demo-group, tapped the group summary, and verified:

  • The notification click listener fires.
  • GroupKey is demo-group.
  • GroupedNotifications contains the grouped notifications.
  • RawPayload is populated on the summary notification and each grouped notification.

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 changes are related to notification payload parity and demo validation
  • Public API changes are explained above and preserve existing constructor signatures

Testing

  • I have included test coverage for these changes, or explained why it was not added
  • All applicable builds and formatting checks pass
  • I have personally tested the platform-specific notification behavior on device

Final pass

  • Code is as readable as possible
  • I have reviewed this PR myself

@fadi-george
fadi-george requested a review from a team as a code owner September 3, 2026 07:51

@abdulraqeeb33 abdulraqeeb33 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.

Approve with nits. Click and display converters now read templateIcon/systemIcon, and Android still uses the 3-arg ctor so Icon is preserved.

  1. The dict-to-ActionButton lookup is pure after NSObjectToPureDict. A shared helper plus fixtures would lock the original key bug.
  2. Demo still has no action-button send type, and the handlers do not print ActionButtons. The PNG names (dashboard value without .png) are also unnamed in the README. Fine as a follow-up.

Comment thread OneSignalSDK.DotNet.iOS/Utilities/FromNativeConversion.cs Outdated
fadi-george and others added 6 commits September 4, 2026 15:27
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george fadi-george changed the title fix: [SDK-5161] expose iOS action button icons feat: [SDK-5161] expose notification metadata and improve demo coverage Sep 4, 2026
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