This is an extension of this question here: Getting Facebook Events using fql
I am running into the problem when there is no location/venue set for the events.
Here is the query I am using:
{\"events\":
\"SELECT eid, name,description, start_time, end_time, pic_small,pic_big, eid,venue,location
from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me()
and start_time > %s)\" ,
\"locations\":
\"select page_id,location from page where page_id IN
(select venue.id from #events)\" ,
\"rsvpStatus\":
\"select eid, rsvp_status from event_member where eid IN
(select eid from #events) AND uid = me()\" }
My observation : when there is location set for this event, the venue atttibute is a json object with and id property. Please refer below json
{
"eid": 34343434322,
"name": "Another yo you",
"description": "",
"start_time": 1347699600,
"end_time": 1347786000,
"pic_small": "http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yy\/r\/XcB-JGXohjk.png",
"pic_big": "http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yn\/r\/5uwzdFmIMKQ.png",
"venue": {
"id": 34243242
},
"location": "Airbiquity"
}
When there is no location set, it is an empty array. Please refer below json.
{
"eid": 441320552577649,
"name": "Meeting",
"description": "",
"start_time": 1347491700,
"end_time": 1347502500,
"pic_small": "http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yy\/r\/XcB-JGXohjk.png",
"pic_big": "http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v2\/yn\/r\/5uwzdFmIMKQ.png",
"venue": [
],
"location": null
}
It's weird that the type of the venue attribute changes. I am GSON to convert this response for Java object and it's throwing off due to unepected structure for venue. Can someone help me with this issue?