userNotificationCenter didReceive response contains empty notification (watchOS)

Viewed 237

I am trying to retrieve the original notification content from userNotificationCenter(_:didReceive:withCompletionHandler:) in watchOS. I have managed to get the callback firing when sending a push notification from APNS, but unfortunately, the response object contains an empty notification:

<UNNotificationResponse: 0x600003bc0b40; actionIdentifier: start, notification: (null)>

I am using the example from Listing 1 from Apple's documentation.

UPDATE 10/19/20

I have created a sample project SampleNotification to reproduce the issue (see README.md on how to reproduce). I have noticed that the callback returns an empty notification only when the user presses the UNNotificationAction. Moreover, I confirmed that this pattern is not observed in iOS.

It appears that the same notification when received in userNotificationCenter(_:willPresent:withCompletionHandler:) is not empty!

I'd appreciate any feedback

1 Answers

I was facing the same issue with watchOS 7.1 and ios 14.1. I contacted the Apple technical support team. This is the reply I got from them

"Our engineers have reviewed your request and have determined that you are experiencing a known issue for which there is no known workaround at this time."

Related