【问题标题】:Foursquare api doesn't return correct checkins informationFoursquare api 不返回正确的签到信息
【发布时间】:2016-12-02 03:20:26
【问题描述】:

我测试了foursquare api,以便在以后的项目中使用它,但遇到了一个奇怪的问题。

我会举例说明。 您通过 Swarm 应用程序签到地点 1 并调用 venue here now 端点

https://api.foursquare.com/v2/venues/559bac8f498effd9368131f6/herenow?v=20160606&oauth_token=<token>

您收到正确的数据,您的用户显示在 items 数组字段中

"response":{"hereNow":{"count":2,"items":[{"id":"583ede91a36ecd3aeee51647","createdAt":1480515217,"type":"checkin","timeZoneOffset":120,"user":{"id":"355625527","firstName":"Dima","gender":"male","relationship":"self","photo":{"prefix":"https:\/\/irs0.4sqi.net\/img\/user\/","suffix":"\/blank_boy.png","default":true}},"likes":{"count":0,"groups":[]},"like":false},{"id":"583ede0a02b60e59094ddbc5","createdAt":1480515082,"type":"checkin","timeZoneOffset":120,"user":{"id":"43963436","firstName":"Ayhan","lastName":"B","gender":"male","photo":{"prefix":"https:\/\/irs0.4sqi.net\/img\/user\/","suffix":"\/43963436-UWAYC333GLM2YQ4H.jpg"}}}]}}

然后您签入到地点 2 并调用相同的端点。签入数据正确,您的用户在 items 数组中。 但是当您签入到地点 1 时,您的用户不包含在 items 数组中

"response":{"hereNow":{"count":1,"items":[{"id":"583ede0a02b60e59094ddbc5","createdAt":1480515082,"type":"checkin","timeZoneOffset":120,"user":{"id":"43963436","firstName":"Ayhan","lastName":"B","gender":"male","photo":{"prefix":"https:\/\/irs0.4sqi.net\/img\/user\/","suffix":"\/43963436-UWAYC333GLM2YQ4H.jpg"}}}]}}

相反,你仍然签入到位置 2。

此外,当您签入最近端点时,它会返回您最近签入是放置 1

"response":{"recent":[{"id":"583ee16ed8b0ed757138ec10","createdAt":1480515950,"type":"checkin","timeZoneOffset":120,"user":{"id":"355625527","firstName":"Dima","gender":"male","relationship":"self","photo":{"prefix":"https:\/\/irs0.4sqi.net\/img\/user\/","suffix":"\/blank_boy.png","default":true}},"venue":{"id":"559bac8f498effd9368131f6","name":"Львiвськi  пляцки","contact":{"phone":"0936567878","formattedPhone":"093 656 7878","facebook":"288574604603052","facebookUsername":"lvivskipljacky","facebookName":"Львівські пляцки"},"location":{"address":"вул. Богдана Хмельницького, 10","lat":50.44546701910413,"lng":30.51702892776601,"labeledLatLngs":[{"label":"display","lat":50.44546701910413,"lng":30.51702892776601}],"postalCode":"01001","cc":"UA","city":"Kyiv","state":"Kyiv City","country":"Ukraine","formattedAddress":["вул. Богдана Хмельницького, 10","Kyiv, 01001"]},"categories":[{"id":"4bf58dd8d48988d16a941735","name":"Bakery","pluralName":"Bakeries","shortName":"Bakery","icon":{"prefix":"https:\/\/ss3.4sqi.net\/img\/categories_v2\/food\/bakery_","suffix":".png"},"primary":true}],"verified":false,"stats":{"checkinsCount":2782,"usersCount":1890,"tipCount":75},"url":"http:\/\/www.fest.lviv.ua\/uk\/restaurants\/lvivskipljacky\/","allowMenuUrlEdit":true,"beenHere":{"unconfirmedCount":0,"marked":false,"lastCheckinExpiredAt":0},"specials":{"count":0}},"source":{"name":"Swarm for Android","url":"https:\/\/www.swarmapp.com"},"photos":{"count":0,"items":[]},"posts":{"count":0,"textCount":0},"likes":{"count":0,"groups":[]},"like":false,"comments":{"count":0},"isMayor":false}]}

有没有人也遇到过这个问题?还是foursquare api对签到有一些限制?我在网上搜索过它,但找不到任何有用的信息

【问题讨论】:

标签: foursquare


【解决方案1】:

用户在签到后或在另一个地点签到之前,将在“Here Now”场所显示 3 小时。在您的示例中,如果用户的签入模式是 Place 1 -> Place 2 -> Place 1,则用户将不会出现在 Place 1s “现在”中。我不确定这是一个错误还是故意作为质量控制。

【讨论】:

  • 感谢您的回答!是的,这是有道理的,但如果能在文档中记录就很好了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-10
  • 2018-11-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多