我使用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];
当我收到活动时,我将它们存储到Core Data。后来当我需要获取信息时(比如事件的图像),我使用'eid'来获取事件的图像。但是我注意到那些“eid”字段与Facebook图形调用返回的字段不匹配。在图表中,我得到了事件的id,并使用它来获取事件图像。
"id": "281780925236476",
我的问题是:如何使用FQL获取图API返回的唯一事件ID?或者我可以使用图形API调用来获得与FQL查询相同的结果:所有事件(可能是批量调用)和所有事件字段。例如,对/ events的图谱API查询不会返回事件的描述。
我正在尝试最大限度地减少来自iOS应用程序的HTTP调用量,并且使用FQL查询似乎就是这样。如果可以实现相同的结果,我更愿意使用Graph API。
由于