[Various]Expose notification delivery and response timestamps to close issue #2780 - #2791
Open
ventisep wants to merge 5 commits into
Open
[Various]Expose notification delivery and response timestamps to close issue #2780#2791ventisep wants to merge 5 commits into
ventisep wants to merge 5 commits into
Conversation
MaikuB
reviewed
Jul 11, 2026
…issue. this change resolves that following testing.
Author
|
That changes to the dismissal flow clashed with some of the changes for introducing the timestamps for exposing notification delivery and response timestamps. I have now merged the latest master and retested using the unit and integration tests which all pass. |
…en available on the screen and log output.
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.
Fixes #2780
Summary
Adds optional notification timing fields to
NotificationResponse:notificationDeliveredAt: the time the OS delivered the notification, where available.responseReceivedAt: the time the native plugin received the notification response callback.These fields are currently populated on iOS and macOS using Apple’s UserNotifications APIs.
Motivation
Apps can receive notification responses later than the user interaction, especially when handling notification actions after the app/background isolate has been started.
Previously, apps that needed to record when a notification was delivered or when the native response callback was received had to fall back to the time Dart processed the callback. That can be inaccurate if Dart handling is delayed.
This change exposes the native timing information so apps can distinguish:
The new fields are nullable, so existing platforms and existing callers remain backwards compatible.
Implementation notes
notificationDeliveredAtandresponseReceivedAtfields to the platform interfaceNotificationResponse.UNNotification.datefornotificationDeliveredAt.responseReceivedAtonce whenuserNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:is invoked.UNNotification.dateand the native notification response delegate callback time.DateTimefields.NotificationResponse.Testing
Tested using:
melos bootstrapmelos run analyzemelos run test:unit <default>Also validated manually on a physical iPhone with a repeating local notification action. The response included:
notificationDeliveredAt=2026-06-28T13:01:00ZresponseReceivedAt=2026-06-28T13:02:12.593Z(1 minute after notification delivered when user selected an action)Dart processing occurred later at
2026-06-28T13:03:12Z, (1 minute later when the user launched the dart app) confirming that the new fields preserve OS/native timing independently of delayed Dart processing.