[SOLVED] How to retrieve Facebook's user data from "developer Facebook"

Issue

I want to create a web app for educational purposes in which I required a search bar which helps me get Facebook’s user data

For example: username, image

These two fields are enough for me.

Is it possible for me to retrieve such data using React.JS?

Solution

Here is the basic steps:

  • Create a facebook app and add facebook login to it.
  • Setup facebook login allowed SDK URls (where you will call the login method) and redirect URL after login.
  • Add needed permissions to your app
  • Add facebook SDK scripts to your react index.html or install the SDK.
  • Using the SDK call FB.login() and from the response save the user access token
  • send a request to FB_API_URL/me to get the user data you want

before all that test your requests to the created app with FB graph API Explorer https://developers.facebook.com/tools/explorer/

Last step: submit your app for review as most permissions will not work before this step.

useful links:
https://developers.facebook.com/docs/graph-api/get-started
https://developers.facebook.com/docs/facebook-login/web

enter image description here

Answered By – sh.e.salh

Answer Checked By – David Goodson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.