-1

Scenario:-

I am in need to fetch photos from facebook albums. And for this I am using Galleria.

Code-Snippet:-

$(document).ready(function (e) {
    alert('jQuery loaded');
    loadGallery();

    function loadGallery() {
        debugger;
        Galleria.loadTheme('js/galleria/themes/classic/galleria.classic.min.js');
        Galleria.run('#galleria', {
            facebook: 'album:123xxxxx',
            width: 745,
            height: 550,
            lightbox: true
        });
    }
});
<!DOCTYPE HTML/>
<html>
  <head>
    <title> Test </title>
     <script src="jQuery"> </script>
    <script src="galleria-1.4.2.min.js"></script>
    <script src="js/galleria.facebook.js"></script>
    
   </head>
  <div id="galleria"></div>
 </html>

Please not I have not mentioned APP_ID or APP_SecretKey in my configuration, as far as I know, when using Galleria, we just need to pass albumID.

But getting the below error:-

enter image description here

Rajan Goswami
  • 769
  • 1
  • 5
  • 17
Kgn-web
  • 7,047
  • 24
  • 95
  • 161
  • read my ios answer may be helped.....http://stackoverflow.com/questions/30207465/ios-facebook-album-photos-picker/31789234#31789234 – Maulik shah Sep 26 '15 at 14:11

1 Answers1

0

Most likely you are trying to get an Album from a User Profile or a Page that is restricted by location or age.

If it´s from a User Profile, you would need to authorize the User with the user_photos permission. If it´s a restricted Page, you can use a Page Token. See those links for more information about Tokens and how to generate them:

Short version: Those plugins usually only allow you to get public albums from (unrestricted) Facebook Pages. For everything else, you would need to create an App and authorize the User.

Btw, those plugins may not even work with a public Album, because the Graph API v2.x requires an Access Token even for those API calls. This is actually mentioned in the docs: https://github.com/aiaio/galleria-facebook

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • _“Those plugins usually only allow you to get public albums”_ – but even if the album is public, an older plugin still might not work any more, if it is not using any access token at all – because API v2 requires an access token even if the album/photos are public. So if users are not forced to login via FB on the site (so that their user access token could be used), the part of fetching the data would need to be moved to the server side (where an app access token or page access token could be used.) – CBroe Aug 12 '15 at 10:01
  • oh, i forgot. you are right, of course. i will add the info to my answer, thanx. – andyrandy Aug 12 '15 at 10:03