fbpx

Get Photos from Albums - Was working before.

Get Photos from Albums - Was working before.

Hi,

Previously I was getting photos using the code below to first get album ids then get the photos. I can still get a list of albums but I can no longer get the photos listed in the album.
From the documentation it seems I am missing an access token. How can i get this access token from JFBConnect to pass to the photos function getAlbumById?




    function getAlbums ()
    {      
        try {       
        return $this->api('me/albums');   
                         
        }     
        catch (Exception $ex) {
            return array();
        }
    }




    function getAlbumById ($aid)
    {
        try {
            $photos = $this->api($aid.'/photos');         
            return $photos;   
        }
        catch (Exception $ex) {
            return array();
        }
    }

Ivan
Ivan
useravatar
Offline
271 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Get Photos from Albums - Was working before.

I have tried this:

   

Code:

   $params['access_token'] = JFBCFactory::usermap()->getUserAccessToken($userid, 'facebook');

         
         
            $photos = $this->api('/'.$fbuserid.'/photos', $params['access_token']);

But no luck

Ivan
Ivan
useravatar
Offline
271 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Get Photos from Albums - Was working before.

I just read through the photos endpoint documentation from Facebook.

In there, it says:

Permissions
Any valid access token for any photo with public privacy settings.
For any photos uploaded by someone, and any photos in which they have been tagged - A user access token for that person with user_photos permission

If the image is public, you should be able to see it always. If it's a private photo, I'd recommend checking the token you're using in the Access Token Debug Tools to make sure you have the user_photos permission.

I hope that helps, but if not, please let me know!

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24428 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11859
Total Polls:
0
Total Posts:
49712
Posts this week:
8
User Info
 
Total Users:
48456
Newest User:
isilem
Members Online:
1
Guests Online:
1036

Online: 
fb_1127481405
Social Stream
Hide, Seek & Defuse

Handheld Electronic Game

Alex from SourceCoast is working on a new electronic game for kids called Countdown. It's a timed game of Hide & Seek with mini-games (Whack-a-Mole, Simon, etc) to complete when you find it.

Hide and Seek Toys

Before You Leave

Let us send you a 10% off coupon

For Your Next Purchase

Please enable the javascript to submit this form

No , I don't want a discount