1

I am fetching user's events using FQL multiquery.

NSString *eventQuery1 = @"SELECT name, start_time, end_time, location, description, venue, host, eid, privacy FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = me() AND rsvp_status='attending' )";
NSString *eventQuery2 = @"SELECT name, start_time, end_time, location, description, venue, host, eid, privacy FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = me() AND rsvp_status='maybe' )";
NSString *eventQuery3 = @"SELECT name, start_time, end_time, location, description, venue, host, eid, privacy FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = me() AND rsvp_status='declined' )";
NSString *eventQuery4 = @"SELECT name, start_time, end_time, location, description, venue, host, eid, privacy FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = me() AND rsvp_status='not_replied' )";
NSString* fql = [NSString stringWithFormat:
                 @"{\"attending\":\"%@\",\"maybe\":\"%@\",\"declined\":\"%@\",\"not_replied\":\"%@\"}",eventQuery1, eventQuery2, eventQuery3, eventQuery4];

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObject:fql forKey:@"queries"];
[_facebook requestWithMethodName:@"fql.multiquery" andParams:params andHttpMethod:@"GET" andDelegate:self];

When I get events I store them to Core Data. Later when I need to get information (like image for event) I use 'eid' to fetch image for event. However I noticed that those 'eid' fields don't match to those returned by Facebook graph calls. In graph I get id for the event and use that to fetch events image later.

"id": "281780925236476",

My question is: How can I get this unique event id returned by graph API by using FQL? Or alternatively can I use graph API calls to get same result as with FQL query: All events (maybe with batch call) and all event fields. Graph API query to /events for example doesn't return description of the event.

I am trying to minimize amount of HTTP calls from iOS application and using FQL queries seems to be the way. I would prefer using Graph API if same result could be achieved.

Thanks

mraty
  • 627
  • 1
  • 7
  • 14
  • 1
    Answering my own question. Haven't checked yet but it seems that I had "too tired" error :) When converting eid to string (which I use internally as id type because of graph API returns strings) I used %d when converting eid to string. Proper way is to use [[result objectForKey:@"eid"] stringValue]; – mraty May 01 '12 at 21:00

0 Answers0