Note that there are some explanatory texts on larger screens.

plurals
  1. POios fb graph api search for places with app or usertoken?
    primarykey
    data
    text
    <p>my app used to have the following fb api graph query (original query) with fb sdk for ios (version 3.1) : </p> <pre class="lang-c prettyprint-override"><code>NSString *fbquery = [NSString stringWithFormat:@"search?type=place&amp;center=48.8567,2.3508&amp;distance=1000&amp;limit=40&amp;fields=picture.width(200),cover]; </code></pre> <p>This does not work anymore. I checked the docs and figured out that it works with appending a app access token. This works well with the following query within fb sdk for ios (version 3.5.3): </p> <pre class="lang-c prettyprint-override"><code>NSString *fbquery = [NSString stringWithFormat:@"search?type=place&amp;center=48.8567,2.3508&amp;distance=1000&amp;limit=40&amp;fields=picture,cover&amp;access_token=%@", appDelegate.session.accessTokenData.accessToken]; </code></pre> <p>Result of the query: </p> <pre class="lang-js prettyprint-override"><code>{ data = ( { id = 165207683494457; picture = { data = { "is_silhouette" = 0; url = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/276836_165207683494457_49288222_q.jpg"; }; }; }, { id = 151161104922563; ... ... </code></pre> <p>But when I try to specify the picture width which I want to retrieve, like in the original query: <code>picture.width(200)</code> then I get an error:</p> <pre class="lang-js prettyprint-override"><code> {com.facebook.sdk:ParsedJSONResponseKey={ body = { error = { code = 1; message = "An unknown error has occurred."; type = OAuthException; }; }; code = 500; }, com.facebook.sdk:HTTPStatusCode=500} </code></pre> <p>The <a href="https://developers.facebook.com/docs/reference/api/search/" rel="nofollow">fb developer docs</a> state: </p> <blockquote> <ul> <li>Searches across <strong>page</strong> and <strong>place</strong> objects requires an <strong>app access token</strong>.</li> <li>All other endpoints require a user access token.</li> </ul> </blockquote> <p>I use already the app access token so it should work, but it does not. </p> <p>What should I do? Where is the issue? </p> <p>My suggestion would be to try with a user access token, but how do I retrieve this from the <code>appDelegate.session</code>? Could not find the user access token there. </p> <p>I use now (as above stated the fb sdk for ios in version 3.5.3. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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