Facebook FQL:获取具有纬度和经度的iOS版本的Userevents

时间:2013-02-28 20:11:34

标签: ios facebook-graph-api facebook-fql

我拼命想要获得具有纬度和经度的Userevents。我正在使用此查询,但它返回一个空的结果集,我不知道为什么。

NSString *eventInfo = @"SELECT name, eid, venue.id, location, start_time, end_time from event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me() AND rsvp_status='attending' OR rsvp_status='maybe'))";

NSString *placeInfo = @"SELECT page_id, name, latitude, longitude FROM place WHERE page_id IN (SELECT venue.id FROM #event)";

NSDictionary *multiQuery = [[NSDictionary alloc] initWithObjectsAndKeys: eventInfo, @"event", placeInfo, @"place", nil];

NSDictionary *queryParams = [NSDictionary dictionaryWithObjectsAndKeys: multiQuery, @"q", accessToken, @"access_token", nil];

3 个答案:

答案 0 :(得分:0)

首先,您不需要第二个查询:您在第一个查询中可以收到的有关场地的所有信息,venue是一个带有名称和坐标的复杂对象。

所以,当你运行查询时

SELECT name, eid, venue, location, start_time, end_time from event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me() and  rsvp_status='attending' OR rsvp_status='maybe')

您应该在venue数组中获取所有场地信息。

答案 1 :(得分:0)

如果您只想查询,请执行以下操作:

{
    "events" : "SELECT privacy, name, description, start_time, venue.id, pic_cover FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me())",
    "venues" : "SELECT latitude, longitude, name, page_id FROM place WHERE page_id IN (SELECT  venue.id FROM #events)"
}

请注意,您需要使用objective-c手动进行连接。所有facebook都可以为我们提供事件列表,以及与事件相关的场地列表。

答案 2 :(得分:0)

尝试此查询,它将返回关于即将到来的事件的所有事情

byte[] dataArray = new byte[] {-60, -65, -82, 44, 36, 69, -96, 64};
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(dataArray));

double val = stream.readDouble();
out.println(val); // -1.4960627518157586E23