javascript - Facebook API - doesn't return all fields for photos -


i using facebook api browse albums, choose album , output photos on page.

i login facebook. accept app permissions. outputs albums on page select from. select album , pass album id page output photos. response doesn't have photo fields, id , created_time.

for example:

//load fb api    (function(d){     var js, id = 'facebook-jssdk', ref = d.getelementsbytagname('script')[0];     if (d.getelementbyid(id)) {return;}     js = d.createelement('script'); js.id = id; js.async = true;     js.src = "//connect.facebook.net/en_us/all.js";     ref.parentnode.insertbefore(js, ref); }(document));  //initialise window.fbasyncinit = function() {     fb.init({     appid      : 'xxxxxxxx',     status     : true,     xfbml      : true,     cookie     : true,     version    : 'v2.4'    }); }  //get albums - works fine. fb.api( "/me/albums", function (response) {         if (response && !response.error) {             data = response.data;             //output albums...         } }); 

i select album , pass page output photos this:

fb.api(     "/album_id/photos",     function (response) {         if (response && !response.error) {             console.log(response);         }     } ); 

this breaks. output in log looks like:

object {data: array[1], paging: object}     data: array[1]         0: object            created_time: "2014-05-07t10:39:31+0000"            id: "xxxxxxxxxxxxxxx" 

and that's it. no other fields. there no errors in log. don't understand why getting data.

the graph api v2.4 reduces number of fields in default responses.

https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/

fewer default fields faster performance: improve performance on mobile network connections, we've reduced number of fields api returns default. should use ?fields=field1,field2 syntax declare fields want api return.

in short, explicitly state fields require part of request.


Comments