the title might suggest it, but i'm looking for a way to have Facebooks graph API work on my localhost. It's a pain if I need to sync up the project to the server every time I want to test, because graph only works when online.
Does anyone have any suggestions on this problem?
You need to register as facebook developer and create you app there. Once you have your web app registered you can go to your app and click on add product. Add Facebook Login. Then enable Web OAuth Login and add your localhost in the textfield below and save, you should be able to access it.
The Legacy REST API is in the process of being deprecated, while the Graph API is the most current, so if you're unsure of which one to use, your best bet is to go with that one. As you suggested, the Graph API, just like the Legacy REST API, is in fact a RESTful API.
Applies to all versions. Facebook Analytics will no longer be available after June 30, 2021. Additionally, we are deprecating the App Dashboard Plugin for Marketing API. For more information visit the Business Help Center.
If you don't need offline access (which is not available, see Jimmy Sawczuk's answer), but only need your website to be able to access the Graph API from your localhost instead of the real domain name, it should be possible.
What you need to do is edit the settings for your site's app on Facebook. Set your applications URL to either 'localhost' or your computers local IP-address, and I think it should work.
tl;dr
Follow the instructions described in this post for the how-to: How To: Local Facebook App Development
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With