Getting all my events via Facebook iOS SDK

前端 未结 5 1337
囚心锁ツ
囚心锁ツ 2021-02-19 07:13

In my iOS app, I get an access token using the following code:

    [self.facebook authorize:[NSArray arrayWithObjects:@\"user_events\",
@\"friends_events\",  nil         


        
5条回答
  •  -上瘾入骨i
    2021-02-19 08:13

    You can get list of events regardless of their RSVP status with next FQL query:

    SELECT eid, name, venue, location, start_time FROM event WHERE eid IN (
      SELECT eid from event_member WHERE uid = me()
    )
    

    This will not return RSVP status for each event but just events details. You may wish to use Batch Requests to get both details of events and rsvp_status with same query.

    https://graph.facebook.com/?method=post&batch=[
      {
        "name":"rsvp",
        "relative_url":"fql?q=SELECT+eid,rsvp_status+FROM+event_member+WHERE+uid=me()",
        "omit_response_on_success":false
      },
      {
        "relative_url":"?ids={result=rsvp:$.data.*.eid}"
      }
    ]
    

    See event and event_member table documentation for details on other fields you may wish to retrieve.

    Notes:

    Starting July 5th, an access token will be required to access even public events.

提交回复
热议问题