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

Thursday, November 3, 2022

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

 November 03, 2022     facebook, facebook-graph-api, reactjs     No comments   

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 Marino (PHPFixing Volunteer)
  • 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