0

I am trying to import some Photos from a Facebook page that I own.

I am following this answer on Stack Overflow, more specifically the Client-Side part.

In the answer 3 steps are suggested.

  1. Add the javascript SDK , which i do.
  2. Something about Authentication but the link is wrong...
  3. A piece of code for rendering the photos.

I skipped the 2nd step , cause I am not sure what to do there and I implemented the code in 3rd step :

FB.api('593959083958735/photos', function(response) {
                if(!response || response.error) {
                    // render error
                    alert("Noo!!");
                } else {
                    // render photos
                    alert("Yeah! " + response.status);
}

From here I get the alert "Yeah! undefined". The response is always undefined. I think maybe because I should have done something in the authentication part.

All I am trying to do here , is to import some photos from a public Facebook page. Is this the correct way to do that? If yes why would I need any authentication for it. And what exactly should I do in the authentication part?

4

1 回答 1

2

From here I get the alert "Yeah! undefined". The response is always undefined. I think maybe because I should have done something in the authentication part.

You are querying the photos from a page, so there is no status field in the response.

All I am trying to do here , is to import some photos from a public Facebook page. Is this the correct way to do that? If yes why would I need any authentication for it.

You don’t need authentication for that – as you can see here in the Graph API Explorer, you get results even without an access token (after clearing the field). And you can see the structure of the response there as well.

于 2013-06-17T11:00:50.190 回答