Page MenuHomePhabricator

[desktop] Handle macos notifications
ClosedPublic

Authored by michal on Feb 24 2023, 10:12 AM.
Tags
None
Referenced Files
F3394574: D6894.diff
Sat, Nov 30, 8:38 PM
Unknown Object (File)
Oct 27 2024, 6:17 PM
Unknown Object (File)
Oct 19 2024, 9:28 PM
Unknown Object (File)
Oct 19 2024, 9:28 PM
Unknown Object (File)
Oct 19 2024, 12:49 PM
Unknown Object (File)
Oct 19 2024, 12:49 PM
Unknown Object (File)
Oct 19 2024, 12:49 PM
Unknown Object (File)
Oct 19 2024, 10:23 AM
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
Branch
michal/desktop-notifs
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

desktop/flow-typed/npm/electron_v22.0.0.js
302–312

Why aren't these read-only?

336–338

Why aren't these read-only?

351–358

Why aren't these read-only?

361–366

Should any of these be read-only?

tomek added inline comments.
desktop/src/push-notifications.js
3

Why do we need to silence this warning?

32
This revision is now accepted and ready to land.Feb 28 2023, 3:21 AM

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