Page MenuHomePhabricator

[Notifications] Update display logic for notifications bell state
Closed, ResolvedPublic


Update the bell button's image depending on available notifications.

  • This task concerns the Bell button visible when logged in and on the Explore feed or when logged in and on the root Settings view if the Explore feed is turned off
  • Show in indicated notification available state as requested by app
  • Show in un-indicated plain state as requested by app

Engineering Needs:
[1] The UI needs API on the Notifications Data Controller to interact with here
[2] What is the mechanism for triggering a state change (Explore/Settings root view appearance, notification, etc.)?


Event Timeline

Per planning - refresh when this icon is seen (foreground, switch back to explore, etc.). Ok if there's a 30 second timeout.

Looks like I missed posting some past engineering sync notes:

We will have a hook on push notification receipt (if permissions are enabled), so we can easily trigger a notifications data refresh (& thus badge state) when we already know there's new data. And of course we'll refresh when they navigate themselves to the app navigation center.

Given that, a refresh on every Explore appearance even with a 30 second timeout seems a bit heavy handed - can we bump this up? Just to be good API citizens.

Engineering sync notes:

  1. We agree that we should immediately trigger a badge refresh upon foreground (and, obviously, upon a launch from terminate state).
  2. For a refresh on appearance of the badge, that could be rather often (probably in viewDidAppear of Explore or Settings). Because this could happen so rapidly my early thoughts that we attempt to refresh the badge on this lifecycle call, but internally within a controller, have it silently fail and not attempt if it's been less than 30 seconds since the last time it refreshed the badge. This area is still up for discussion, to be continued when we pick it up for development.
JMinor claimed this task.