Skip to content

feat: add IDisplayableOSNotification type #133

Merged
sherwinski merged 3 commits intomainfrom
feat/snippet/add-notification-displayableOSNotification
Feb 27, 2026
Merged

feat: add IDisplayableOSNotification type #133
sherwinski merged 3 commits intomainfrom
feat/snippet/add-notification-displayableOSNotification

Conversation

@sherwinski
Copy link
Contributor

Description

Adds the IDisplayableOSNotification interface extending IOSNotification with the display() method. Updates NotificationForegroundWillDisplayEvent to use IDisplayableOSNotification.

Details

OneSignal/OneSignal-Website-SDK#1426 attempted to add display() and preventDefault() to the web API spec but they don't get picked up by web shim. The current pattern is to hardcode them as snippets so they get inlined into the web wrappers.

Add the `IDisplayableOSNotification` interface extending `IOSNotification` with the `display()` method. Update `NotificationForegroundWillDisplayEvent` to use `IDisplayableOSNotification`.
sherwinski added a commit to OneSignal/OneSignal-Website-SDK that referenced this pull request Feb 27, 2026
The "events" key in api.json gets ignored by web shim. Instead, we need to update web shim's snippets to include event interfaces, see: OneSignal/web-shim-codegen#133
}

export interface IDisplayableOSNotification extends IOSNotification {
display(): void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: could add tsdoc for this method

@sherwinski sherwinski merged commit f35acd7 into main Feb 27, 2026
4 checks passed
@sherwinski sherwinski deleted the feat/snippet/add-notification-displayableOSNotification branch February 27, 2026 16:28
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