Note that there are some explanatory texts on larger screens.

plurals
  1. POMalformed access_token in graph request from Android app
    text
    copied!<p>I have an app using the Android Facebook SDK 2.0. I am not able to upgrade this at this time so migrating to SDK 3.0 is not a viable solution.</p> <p>I'm usting a Facebook instance called fb and have successfully requested and gained permissions. I am able to retrieve a list of albums the user has using the following code:</p> <pre><code>String json = fb.request("/me/albums"); </code></pre> <p>I successfully get the list and am able to construct an array of objects containing only the data I need.</p> <p>What I'm trying to accomplish is downloading the cover photo so that I can display this to the user. I have tried making a raw http request to <code>https://graph.facebook.com/me/picture/&lt;picture id&gt;?type=square&amp;access_token=&lt;access token given by fb.getAccessToken()&gt;</code>. When I make the request I get a 400 response code (invalid request). I thought this had something to do with Facebook redirecting away to akamai for the actual image and updated the code to make a second graph request through the Facebook class.</p> <p>I am now making the request <code>fb.request("/me/picture/&lt;picture id&gt;?redirect=false")</code> to get the json data containing the akamai url. I get a message that I must provide an access token, so I added <code>&amp;access_token=&lt;access token given by fb.getAccessToken()&gt;</code> and receive an error that the access token is malformed.</p> <p>I know for certain that the user is not logged out between these requests so there should be no issue there.</p> <p>I must be doing something wrong but I don't see what it is.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload