NSUserNotification deprecation warnings after updating to JUCE 8

After updating an application that makes use of juce Push Notifications from JUCE 7 to JUCE 8.0.2 I get warnings like that when building for macOS:

/path/to/juce/modules/juce_gui_extra/native/juce_PushNotifications_mac.cpp:43:12: warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
    static NSUserNotification* juceNotificationToNSUserNotification (const PushNotifications::Notification& n)

It’s a CMake based project and have PUSH_NOTIFICATIONS_ENABLED flag set to TRUE in juce_add_gui_app. I’m building with Ninja using the Xcode 15.2 toolchain on macOS 14, the projects deployment target is set to macOS 11.

Maybe building with push notifications enabled is not covered by the JUCE internal CI test so that this one slipped through?

Thank you for reporting this. These classes will indeed have to be rewritten to use the new notifications facilities. For the time being we’re suppressing the warnings to have clean builds. The change is on develop

1 Like