Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving Facebook check ins using iOS graph API - no data
    primarykey
    data
    text
    <p>I'm trying to use Facebook's Graph API to retrieve a list of checkins for myself from an iPhone application. I've requested a token and am able to access my profile information and a list of my friends, but when I request checkins I always get back an empty record set. I'm guessing it has something to do with the permissions I'm requesting, but I can do the query with the same permission on the Facebook Graph API Explorer (<a href="https://developers.facebook.com/tools/explorer?method=GET&amp;path=me%2Fcheckins" rel="nofollow">https://developers.facebook.com/tools/explorer?method=GET&amp;path=me%2Fcheckins</a>) and I do get data.</p> <p>Token request:</p> <pre><code>NSArray *perm = [NSArray arrayWithObjects: @"user_status", @"user_events", @"user_location", @"friends_checkins", @"friends_status", nil]; [FBSession openActiveSessionWithReadPermissions:perm allowLoginUI:YES completionHandler: ^(FBSession *session, FBSessionState state, NSError *error) { //handle the session opening }]; </code></pre> <p>Then when I try to retrieve the checkins (in seperate view controller):</p> <pre><code>[[FBRequest requestForGraphPath:@"/me/checkins"] startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary&lt;FBGraphObject&gt; *checkins, NSError *error) { if (!error) { NSLog(FBSession.activeSession.description); NSArray *data = [checkins objectForKey:@"data"]; for (FBGraphObject *c in data) { //execution never gets here because data is empty } } }]; </code></pre> <p>The execution never reaches the <code>for</code> loop because the <code>data</code> variable is empty.</p> <p>I've printed out the current session state just before the <code>for</code> loop to ensure that everything is correct. the result was:</p> <pre><code>&lt;FBSession: 0x15555555, state: FBSessionStateOpen, loginHandler: 0x5555555, appID: 55555555555, urlSchemeSuffix: , tokenCachingStrategy:&lt;FBSessionTokenCachingStrategy: 0x15555555&gt;, expirationDate: 4001-01-01 00:00:00 +0000, refreshDate: 2013-05-15 06:55:56 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:( "user_status", "user_events", "user_location", "friends_checkins", "friends_status" )&gt; </code></pre> <p>I can't figure out what I might be missing.</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