microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.45k stars 132 forks source link

[Cherry Pick] Refactor RCTPushNotificationManager to use `UNNotification` #2031

Closed Saadnajmi closed 7 months ago

Saadnajmi commented 7 months ago

Please select one of the following

Summary:

This change is part of a series of cherry-picks intended to bring visionOS support to React Native macOS. Thes

Prior to these commits, `RCTPushNotificationManager used UILocalNotification on iOS, and we ifdef'ed macOS to use to use NSUserNotification. Both are deprecated and replaced with the cross-apple-platform UNNotification API. Let's cherry pick these changes to make adding visionOS support easier.

Notably excluded from these PRs was properly supporting remote notification on macOS. I didn't see an obvious equivalent for that, and I don't think we supported it before either. I'll leave that as a future task.

Test Plan:

RNTester actually doesn't have a test page for PushNotificationManager, so I don't have a good way to test this. I'll leave the build passing as a good sign