Handling of Actions in UNUserNotificationCenterDelegate broken in watchOS 5 beta 4 - response.notification is null

Originator:rgropmair
Number:rdar://42328770 Date Originated:18-Jul-2018
Status:open Resolved:
Product:watchOS + SDK Product Version:watchOS 5 beta 4
Classification:bug Reproducible:Yes
 
When I try to handle actions on the watch with the UNUserNotificationCenterDelegate, it doesn't work anymore on watchOS 5.
Reason is that the response object handed into the delegate does NOT have a notification object anymore (that works fine on watchOS 4 / Xcode 9)

Interesting enough, if you tap the notification on the watch (not one of the action buttons), the delegate DOES receive a notification object (see below).

But if you tap one of the action buttons, the notification is always null.


Steps to Reproduce:
1. Run the attached Xcode project, scheme MyTest WatchKit App (Notification)
2. once the notification shows up on the watch, tap the button 'First Button'
3. check the console log - the notification object in the response is null

Expected Results:
the response object has a notification:
userNotificationCenter(_:didReceive:withCompletionHandler:) <UNNotificationResponse: 0x7a7a6760; actionIdentifier: com.apple.UNNotificationDefaultActionIdentifier, notification: <UNNotification: 0x7a7a6a50; date: (null), request: <UNNotificationRequest: 0x7a79bad0; identifier: 6EAE09A5-49A8-4222-8FBE-EDFF250A9623, content: <UNNotificationContent: 0x7a79bb50; title: Optional title, subtitle: Optional subtitle, body: Test message, summaryArgument: (null), summaryArgumentCount: 0, categoryIdentifier: myCategory, launchImageName: , threadIdentifier: 5280, attachments: (
), badge: (null), sound: (null),, trigger: <UNPushNotificationTrigger: 0x7a7a6b50; contentAvailable: NO, mutableContent: NO>>>>

Actual Results:
the response object has an *empty* notification
userNotificationCenter(_:didReceive:withCompletionHandler:) <UNNotificationResponse: 0x78763ab0; actionIdentifier: firstButtonAction, notification: (null)>

Version/Build:
Xcode 10 beta 4, watchOS 5 (16R5322d)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!