I am quite confused with access tokens from Facebook ... how do I get access to the user and an access token Get data from the graph API
window.fbAsyncInit = function () {FB.init ({appId: 'app ID', condition: true, cookie: true, xfbml: true, oauth: True,}); FB.getLoginStatus (getStatus); FB.Event.subscribe ('auth.authResponseChange', getStatus); Function getStatus (feedback) {if (response.status === 'connected') {var accesstooken = response.authResponse.accessToken; Console.log ("accessToken =" + AccessToken); $ .ajax ({datatype: "jsonp", type: "gET", url: "https://graph.facebook.com/me/albums?access_token=" + access token, success: function (data) {$. Each (data, function (index, value) {console.log (index + ":" + value);})}}}); }}}; However, I always get empty data after visiting the graph API document here: and click on a graph link, I know that the generated access token is always my code What is different from what it receives from For example, the graph API's current access token in documents
"AAAAAAITEghMBAMwuyHZCO3VOAvCm9hHpaZC9PGV9238ixsZB7zSfuplZBTZCLRj6cEViZADJlVcjOfInwvcbhqu3XBF1w4ZAxvPbexcGQZAYzb4bHAKsMbLF"
console a log
The "AAAG0ZCFantJ8BAAFcMdDOyDyT4OBtjrvULEaS2o94gZAU7U1xITaogFXCZBghQP8G9bjEh3XSCATQOZCUSZCuNWFvEfypIAmcz9bkbk5qRBlHUZAOE4guW" < P> I think I may have done it wrongly Can someone explain me correctly to recover data from the graph API?
Any kind of help would be appreciated. Thanks in advance :)
First run this URL with your authToken:
https://graph.facebook.com/me/permissions?access_token=USER_ACCESS_TOKEN You will almost certainly see the original permission in response, this is why you do not Taking the data from your call to the user's album
If you want to run your user again, make sure that you (probably 'user_photos' in your case).
More information is available in those two links. Good luck!
Comments
Post a Comment