0

I am creating an iOS app which displays a public Facebook post data in the app with some other activities on those post data. As of now, I am sending FB graph api requests to fetch post data from my app itself. Like:

  1. login with Facebook and fire an API get request to that group.

  2. store the response JSON data to Firebase database.

  3. fetch data from Firebase database and display it in app.

The problem with this is, If a user does a Facebook login-in, in the app, API requests will be fired from his/her authentication.

I want to fetch group post data from my Facebook authentication only, so that the data will be available to non logged in users also.

So, is it possible in Firebase to write a server script that will fetch data, periodically into Firebase Database, always with my authentication. And later on I can receive data from that database and display it to users.

                 send API req from server                     fetch data from DB
Facebook Graph API <-------------------Firebase Database ---------------------> iOS App
triandicAnt
  • 1,328
  • 2
  • 15
  • 40

1 Answers1

1

This is definitely possible. Have your server code use the Facebook Authentication API to sign in Facebook and the Firebase Authentication API to sign in to the database.

Then read the posts from Facebook and write them into the (secured) location in your database. Your iOS can then simply read this location. This essentially comes down to pattern 2 as described in this blog post on common Firebase application architectures.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807