Before implementing notifications we should complete this task.
This ticket will accomplish:
- Move the feed to a push model
- Make the feed stable as it loads new content
- Ensure content is downloaded before it is displayed
- Give power to the user to refresh the feed
- Allows the feed to easily scale to new types data
- Allows the feed to send local push notifications
- Allows the feed to migrate to using real push notifications when implemented server side
Along with this, we should implement T138039 too ensure we use too much data since we will be preemptively downloading data.
To implement:
- Create a "Feed Source" for each type of item (feature article, nearby, etc).
A feed source should be a combination of the non-UI logic of section controllers + the business logic of the section schema
Should fetch new data and persist it
Should poll its data periodically and should have a setting to control its frequency
Should use a lower QoS for background fetching
Should use background APIs to download data at an interval when the app is backgrounded
Should emit an event/delegate call when new data is available
Should have similar methods from the section controllers
Feed sources will also be responsible for issuing local push notification
Specifically we should create a feed source that asks for the user location permission
- Refactor the feed section schema to be just a "feed"
This class should responsible fetching feed items from disk and maintain the in memory list
It should update its list when it gets a notification from a feed source
It should retain feed sources
It should manage the business logic for feed sources (do we need the location feed source?)
- Feed VC
The feed VC will create cells for each model object
It owns the feed
It will enable disable the feed and force loads based on the app status and user input