dejanstojanovic / Facebook-Album-Browser

jQuery plugin for browsing public albums of a Facebook account
http://dejanstojanovic.github.io/Facebook-Album-Browser/
MIT License
74 stars 42 forks source link

About the accessToken #20

Closed danielemesh closed 9 years ago

danielemesh commented 9 years ago

Which access token should I use for getting a specific user albums? I am trying to get the albums of a specific user (the user who connect to my app), but for some reason I cant. I tried using the user access token returned from the getLoginStatus function:

FB.getLoginStatus(function (response) {
    accessToken = response.authResponse.accessToken);
});

and my app's access token which I retrieved like you said from: https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=APP_ID&client_secret=APP_SECRET

both doesn't work... Am I missing something?? Thanx :)

dejanstojanovic commented 9 years ago

Hi,

In case you want to access photos of the user who visits your page, you need to create Facebook App and give it special permissions to access account photos. this will require you to send for approval from Facebook. It will take some time until they approve it and they will ask for a bunch of proofs that you are not going to use this as a malicious website. I did it once and it was hell :) Finally when you get your app approved you need to obtain a token when user allows your app to access his account. Try to get approval for your fb app first and the rest is easy :)

danielemesh commented 9 years ago

Are you sure? Maybe things have changes since you did it? I sure hope so... :( In the Facebook tutorials they didn't mention it.. only the use of user_photos permission when a user logs in to the app. And that way I do have access to the photos, I can query them. BTW I do get the albums of pages such as the natgeo and others when using your access token (the one in the example), but when I am trying to use my token it doesn't work, even for pages...

danielemesh commented 9 years ago

Just realized you were right! Nightmare...

dejanstojanovic commented 9 years ago

You will get it eventually, it just takes a lot of time and nerves especially if you have a deadline and you haven't encounter this :)