Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Count number of views for each article #30

Open
jeffreyAaron opened this issue Mar 1, 2021 · 5 comments · May be fixed by #31
Open

Count number of views for each article #30

jeffreyAaron opened this issue Mar 1, 2021 · 5 comments · May be fixed by #31
Labels
Android For Android version enhancement New feature or request iOS For iOS version

Comments

@jeffreyAaron
Copy link
Member

Add a feature to track the number of times users view each article.

This data can be used to create a "Trending" or "Most Popular" section on our app and it also helps us know the types of articles that users like reading.

  • Articles that are already added to the database will start at zero views.
  • The number of views for each article are stored in the "views" property. Not all articles will have the "views" property and for these articles, just assume that the number of views is zero.
@jeffreyAaron jeffreyAaron added enhancement New feature or request Android For Android version iOS For iOS version labels Mar 1, 2021
@xingyzt xingyzt linked a pull request Mar 1, 2021 that will close this issue
@xingyzt xingyzt linked a pull request Mar 1, 2021 that will close this issue
@richardwei6
Copy link
Member

richardwei6 commented Mar 1, 2021

Wait, when you say some articles won't have the views property, do you mean bulletin articles?

@jeffreyAaron
Copy link
Member Author

I mean that any article might not have the views property, even featured or articles on the homepage. The articles that don't have the views property will have this property added in firebase once the user views it at least one time.

This is because almost all of the articles in firebase don't have the views property so instead of adding the property to them all at once, we can update them as needed. So if views == null for any article, then assume 0 views. After the user has viewed the article for one time, then views property will be added.

@xingyzt
Copy link
Member

xingyzt commented Mar 1, 2021

I can initialize all views to zero on the new database rn.

@jeffreyAaron
Copy link
Member Author

By new database, you mean arcadia-high-mobile right?

@xingyzt
Copy link
Member

xingyzt commented Mar 1, 2021

ahs-app
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android For Android version enhancement New feature or request iOS For iOS version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants