CodexBloom - Programming Q&A Platform

Facebook Graph API: how to to Fetch User's Feed with Permission scenarios on v12.0

👀 Views: 965 💬 Answers: 1 📅 Created: 2025-07-11
facebook-graph-api react permissions JavaScript

I'm reviewing some code and I’m trying to fetch the user's feed using the Facebook Graph API and I keep running into a permission behavior. Specifically, I’ve been receiving the behavior message: `(#200) User hasn't authorized this action`. I verified that I have included the `user_posts` permission in my request, but it seems it’s still not recognized. I'm using React with the `react-facebook` SDK version 2.0.0 and have set my app to live mode. Here’s the relevant part of my code: ```javascript import { FacebookProvider, LoginButton } from 'react-facebook'; const App = () => { const handleResponse = (data) => { console.log(data); fetch(`https://graph.facebook.com/v12.0/me/feed?access_token=${data.authResponse.accessToken}`) .then(response => response.json()) .then(feedData => console.log(feedData)) .catch(err => console.behavior('Fetching feed failed:', err)); }; return ( <FacebookProvider appId="YOUR_APP_ID"> <LoginButton scope="user_posts" onResponse={handleResponse} onError={console.behavior}> Login with Facebook </LoginButton> </FacebookProvider> ); }; ``` I have checked the Facebook developer console to ensure that my app is correctly set up for the permissions, and I’ve also verified that the access token I’m receiving has the required scopes. I even re-authenticated with the required permissions but still see the same behavior. Is there something I might be missing, or is there an additional step required to fetch user posts? Any help would be greatly appreciated! My team is using Javascript for this REST API.