Page MenuHomePhabricator

Export all react-native methods needed to replace rect-native-notifications
ClosedPublic

Authored by marcin on Dec 28 2022, 6:45 AM.
Tags
None
Referenced Files
F3248325: D6072.diff
Fri, Nov 15, 9:22 AM
Unknown Object (File)
Wed, Nov 13, 1:09 AM
Unknown Object (File)
Wed, Nov 6, 6:31 AM
Unknown Object (File)
Tue, Nov 5, 10:01 PM
Unknown Object (File)
Mon, Nov 4, 3:23 AM
Unknown Object (File)
Mon, Oct 28, 10:53 PM
Unknown Object (File)
Mon, Oct 28, 10:53 PM
Unknown Object (File)
Mon, Oct 28, 10:53 PM
Subscribers

Details

Summary

This differential implements all RCT_EXPORTED methods needed to replace react-native-notifications. Methods are implemented as in Ashoats fork.

Test Plan

This will be a matter of subsequent diffs, but for the sake of testing one can replace NotificationsIOS.<...> methods with CommIOSNotifications methods of the same name.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 28 2022, 6:50 AM
Harbormaster failed remote builds in B14832: Diff 20223!

Add necessary formatting function

All methods in this differential are copied form Ashoat's fork https://github.com/Ashoat/react-native-notifications/blob/master/RNNotifications/RNNotifications.m. Subtle visual differences are results of applying formatter.

Copy pasted code will be refactored

Update diff since CommIOSNotificationsBridgeQueue API changed

ashoat requested changes to this revision.Jan 9 2023, 10:05 AM

Remove conditionals throughout please, and please think more carefully about every line you write. You should know why you are writing if ([UNUserNotificationCenter class]) {, but in this case it seems like you did not know, and instead were simply copy-pasting

native/ios/Comm/CommIOSNotifications/CommIOSNotifications.mm
421 ↗(On Diff #20702)

Remove this conditional please, it's irrelevant as we target a minimum of iOS 13 now and this class was introduced in iOS 10

(I didn't see the "planned changes", so perhaps you were still working on this)

(I didn't see the "planned changes", so perhaps you were still working on this)

Yes, you are right - I forgot to hit "Plan Changes" on this differential. I haven't refactored it yet to remove copy-pasted code.

You didn't forget, I just didn't see it!

  1. Consequently use dot syntax.
  2. Remove redundant check for [UNNotificationCenter class]
  3. Change implementation of getAllDeliveredNotifications:()callback - we are using different formatting method, but it is still correct.
This revision is now accepted and ready to land.Jan 17 2023, 8:24 AM