0

I'm trying to get a page's public feed with the facebook JS API/Open Graph, but I keep getting an error saying "An access token is required to request this resource.". It looks like it's requesting something along the lines of an access token, but this requires for the user to log into facebook, and I want this to just show a page's public feed without having to login. Is this possible?

This is my code:

window.fbAsyncInit = function() {
    FB.init({
        appId      : '278343965835848',
        xfbml      : true,
        version    : 'v2.6'
    });

    FB.api('/100006804306358/feed', response => {
        console.log(response);
    });
};

(function(d, s, id){
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    /*js.src = "//connect.facebook.net/en_US/sdk.js";*/
    js.src = "//connect.facebook.net/en_US/sdk/debug.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
sgarcia.dev
  • 5,671
  • 14
  • 46
  • 80

0 Answers0