Search code examples
eventsfacebook-graph-apiappcelerator

Facebook graph api Events and Venue Information, sometimes it only returns venue id when the event was created in a known venue


I'm creating an app in Titanium that uses the Facebook Graph API to get all the users events, however, the venue information, it only brought to me, after I was very specific about the field, and some times, a lot of the times, when the Event was created in a known location, it only brings the venue_id, and when I query the venue(via http://graph.facebook.com), then it gives me the venue location details, more importantly, the latitude and longitude of the thing.

Is it possible to bring the information of the venue in the same response?

Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?

Ti.Facebook.requestWithGraphPath('me/events?limit=5000&fields=id,owner,name,description,start_time,end_time,location,venue,privacy,updated_time', {}, 'GET', function(e) {
obj = JSON.parse(e.result);
Ti.API.info('Events: '+JSON.stringify(obj));
}}); // Facebook Events

Solution

  • Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?

    Not sure what exactly you mean by “recommended” … if you mean events the user has been invited to, then you can query the FQL event_member table with the user id.

    You can kind of “join” the info from the table above with the event table by selecting from that using WHERE eid IN (SELECT … FROM event_member WHERE …)

    Is it possible to bring the information of the venue in the same response?

    Using a multi-query you can do it, similar to as it is described here: FQL: query for event table returns venue.name instead of venue.id