这是此问题的扩展: Getting Facebook Events using fql
当没有为活动设置位置/地点时,我遇到了问题。
这是我正在使用的查询:
{\"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()\" }
我的观察:当为此事件设置了位置时,场地属性是一个带有 id 属性的 json 对象。请参考下面的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"
}
当没有设置位置时,它是一个空数组。请参考下面的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
}
场地属性的类型发生了变化,这很奇怪。我是 GSON 来将此响应转换为 Java 对象,但由于场地结构出乎意料,它被抛出。有人可以帮我解决这个问题吗?