PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] How to integrate news article / comments with Firebase?

 March 12, 2022     android, firebase, firebase-realtime-database, wordpress     No comments   

Issue

I've been trying to create an app that follows these three steps:

  1. Register via Facebook
  2. Create new user in Firebase database
  3. Allow registered users to see news articles and comment

I am stuck on #3. I'm not sure this is efficient, but I want to post articles on a site such as Wordpress or whatever and parse the JSON to the app. However, I do not know how to implement the comments.


Solution

You could have, in the Firebase realtime DB, a structure like:

[root]    
    -[article_urls]
        -[comments]
            -[comment_id]
                -[content]->value
                -[user_id]->value

etc. The interesting bit of the Firebase database documentation would be:

  • best practice firebase database: ie, keep your data flat
  • How to add data to a list in Firebase database: When you add a new comment to an article you are actually adding it to a list


Answered By - Sistr
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing