使用Facebook JS SDK 2.11请求user_posts权限失败求助
user_posts Permission in FB.login (SDK v2.11) Hey there, let's work through this issue where your user_posts permission isn't showing up in the login dialog and isn't appearing in the /me/permissions response. I've dealt with similar Facebook permission quirks before, so here's what you need to know:
Why This Happens
First off, user_posts is a review-required advanced permission—Facebook doesn't make it available by default, even in developer mode. This applies to both regular users and even Facebook's own review team if your app isn't set up correctly for testing.
Step-by-Step Fixes
1. Initiate the Permission Request in Facebook Developer Dashboard
Even if you haven't submitted your app for full review, you need to start the permission request process to unlock it for testing:
- Go to your app's dashboard in the Facebook Developer后台
- Navigate to App Review > Permissions and Features
- Find
user_postsin the list, click Request, and fill out the required basic details (like your app's privacy policy URL, a description of how you'll use the permission). You don't need to submit it for review yet—just saving the draft is often enough to enable it for internal testing.
2. Ensure Your Test Account is an Internal Role
Only users assigned as Admin, Developer, or Tester for your app can access review-required permissions in developer mode:
- Go to Roles > People in your app dashboard
- Add the Facebook account you're using for testing (and make sure the review team's accounts are added here too, if they're testing on your app)
3. Double-Check Your FB.login Call
A small typo or missing detail can break permission requests:
- Confirm your
scopeparameter is correctly formatted (adding a basic permission likepublic_profilealongsideuser_postscan help trigger the dialog):FB.login(function(response) { // Handling code here }, { scope: "public_profile,user_posts" }); - Verify your FB.init call uses the correct app ID and SDK version (note: v2.11 is quite old—consider upgrading to a newer stable version like v18.0, as older SDK versions may have deprecated permission request flows).
4. Verify Permissions After Login
Once you've adjusted the above, log in again and check the permissions with:
FB.api('/me/permissions', function(response) { console.log('Granted permissions:', response.data); });
If user_posts still isn't there, double-check that you saved the permission request draft in the dashboard and your test account is properly added as an internal role.
For the Facebook Review Team
If the review team is hitting the same issue, make sure they're using a test account that's added to your app's internal roles, and that you've completed the initial permission request setup in the dashboard. Sometimes review teams need explicit access to test review-required permissions.
内容的提问来源于stack exchange,提问作者Raman Choudhary

