Page MenuHomePhabricator

[desktop] Handle macos notifications
ClosedPublic

Authored by michal on Feb 24 2023, 10:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 12:04 PM
Unknown Object (File)
Fri, Mar 15, 9:52 AM
Unknown Object (File)
Fri, Mar 15, 9:51 AM
Unknown Object (File)
Tue, Mar 12, 5:07 PM
Unknown Object (File)
Thu, Mar 7, 1:31 PM
Unknown Object (File)
Thu, Mar 7, 12:17 PM
Unknown Object (File)
Thu, Mar 7, 11:49 AM
Unknown Object (File)
Feb 21 2024, 2:09 PM
Subscribers

Details

Summary

Register for push notifications and handle them by displaying a native notification. When a user clicks the notification we either navigate to the corresponding chat or if there is no main windows open a new one with a correct url.

Test Plan
  • Check if the notifications display and navigate to a chat when clicked
  • Check if the app is closed notifications show up and open up a new window when clicked
  • Check if we get the notification but then close the app and the other way around, the click action still works correctly

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

desktop/flow-typed/npm/electron_v22.0.0.js
302–312 ↗(On Diff #23072)

Why aren't these read-only?

336–338 ↗(On Diff #23072)

Why aren't these read-only?

351–358 ↗(On Diff #23072)

Why aren't these read-only?

361–366 ↗(On Diff #23072)

Should any of these be read-only?

tomek added inline comments.
desktop/src/push-notifications.js
3 ↗(On Diff #23072)

Why do we need to silence this warning?

32 ↗(On Diff #23072)
This revision is now accepted and ready to land.Feb 28 2023, 3:21 AM
desktop/src/push-notifications.js
3 ↗(On Diff #23072)

Fix typo.
The types aren't readonly because either:

  • they are class methods and can't be made readonly
  • the NotificationEvents type isn't actually ever instantiated or exported, it's just a holder that maps event string name to the callback type