Page MenuHomePhabricator

Extend CommIOSNotification module with method to send an event to JS to trigger message infos persistence
ClosedPublic

Authored by marcin on Apr 3 2023, 3:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 16, 6:22 AM
Unknown Object (File)
Fri, Jun 14, 5:59 PM
Unknown Object (File)
Fri, Jun 14, 6:59 AM
Unknown Object (File)
Wed, Jun 12, 5:50 AM
Unknown Object (File)
Mon, Jun 10, 4:58 PM
Unknown Object (File)
Mon, Jun 10, 3:23 AM
Unknown Object (File)
Wed, Jun 5, 1:47 PM
Unknown Object (File)
Wed, Jun 5, 1:47 PM
Subscribers

Details

Summary

This differential adds method to CommIOSNotifications module that can send event to JS to persist in redux message infos that wasreceived by Notification Service Extension while the app was in the background.

Test Plan

Build the app. Call this method in didReceiveNotification callback in AppDelegate with dummy message infos. Subscribe in JS to log message infos to console.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

marcin requested review of this revision.Apr 3 2023, 4:10 AM
tomek added inline comments.
native/ios/Comm/CommIOSNotifications/CommIOSNotifications.mm
271 ↗(On Diff #24564)

This string is used twice - maybe we can extract it to a constant?

This revision is now accepted and ready to land.Apr 7 2023, 2:23 AM
native/ios/Comm/CommIOSNotifications/CommIOSNotifications.mm
271 ↗(On Diff #24564)

To be consistent we would have to do so for every string that represents a certain event we send to JS (each string in supportedEvents method is used twice in the same manner). This will be done along with https://linear.app/comm/issue/ENG-2842/export-javascript-event-names-as-constants-in-native-modules. For now I would leave it as it is in order to be consistent with the rest of the code.