使用Facebook Graph API获取地址返回null的问题求助
Let's walk through the likely gaps in your workflow—this is a common issue with Facebook's strict permission and privacy controls, so you're not alone here!
Double-check that the
user_addresspermission was actually granted
Just checking the box in the Graph Explorer doesn't guarantee the permission is active. When you create the token, Facebook should prompt you to authorize access to your address data. If this popup was blocked (by your browser, for example) or you didn't explicitly confirm it, the permission won't be included in your token. To verify, click the "i" icon next to your token in the Explorer to view its scopes—make sureuser_addressis listed under "Granted Permissions".Verify your address privacy settings
Even if you've set an address in your profile, Facebook's privacy settings might block the API from accessing it. Head to your profile's address edit page, click the privacy dropdown, and ensure it's set to a level that allows your own account (and the API) to access it. For testing, setting it to "Public" temporarily can help rule out privacy as the issue.Confirm you're using the correct API syntax
Make sure your query is explicitly requesting the address field from the/meendpoint. Your final query should look like this:/me?fields=addressUsing an outdated API version (e.g., older than v10.0) might also cause issues—stick to the latest stable version listed in the Explorer's API version dropdown.
Check for permission approval requirements
For non-testing scenarios, some permissions likeuser_addressrequire app review from Facebook. However, if you're using your own personal account with the Graph Explorer (not a third-party app), this shouldn't be an issue. But if you're testing with an app that's not in development mode, you might hit review barriers.Wait for data synchronization
Occasionally, Facebook takes a minute or two to sync profile changes to its API servers. If you just added the address, wait 5-10 minutes before re-running your query to rule out sync delays.
Hope these steps help you get the address data you're looking for!
内容的提问来源于stack exchange,提问作者Tobias Heuts

