UNNotificationCategory Not Updating in Notification Service Extension Targets

Originator:brad
Number:rdar://45325233 Date Originated:10/16/2018
Status:Duplicate (OPEN) Resolved:
Product:iOS Product Version:12.0.0
Classification:UserNotifications Framework Reproducible:Sometimes
 
Area:
UserNotifications Framework

Summary:
We have a popular push notification SDK (OneSignal). Our SDK allows apps to attach images to their push notifications dynamically. To do this, we register buttons/etc. to a UNNotificationCategory in a Notification Service Extension.

This has worked perfectly since iOS 10. However, now in iOS 12, we are seeing occasional issues, especially for newly installed apps, where actions/attachments registered to a UNNotificationCategory don't show up on notifications. 

Steps to Reproduce:
1. Add a Notification Service Extension target to an app
2. In the Notification Service Extension in the `didReceiveNotificationRequest` method, create a `UNNotificationCategory` and add some actions to it, and register the new category using `UNUserNotificationCenter.current.setNotificationCategories([your_category])`
3. To make sure the notification uses this category, on the `UNMutableNotificationContent` instance, set the `categoryIdentifier` to be the same as the category created in step 2

Expected Results:
The notification should now have the buttons from step 2. 

Actual Results:
However in our testing (and for many app developers using our SDK), notifications often seem to ignore the category identifier and don't show the correct actions.


Version/Build: iOS 12.0.0

Comments

DUPLICATE OF 44436126 (OPEN)

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original report your bug was duplicated to appears in a text box within the bug detail section of the bug reporter user interface. For security and privacy reasons, we don't provide access to the original bug yours was duped to.

If you have any questions or concerns, please update your report directly at this link: https://bugreport.apple.com/.

My response

Here is an example project that reproduces this issue - I have also attached a README.

(Here is the example project I sent to Apple). https://www.dropbox.com/s/4gk1m3si7ze7p69/ExampleProject.zip?dl=0

Apple Developer Relations

Please provide a focused sample project or app that demonstrates this issue.

Instructions for any OS: https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/Test_Case_Requirements.pdf

For a complete list of logging instructions visit: https://developer.apple.com/bug-reporting/profiles-and-logs/


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!