Getting all my events via Facebook iOS SDK

前端 未结 5 1330
囚心锁ツ
囚心锁ツ 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 07:53

    Use /me/events for getting the events the user has responded to, and /me/events/not_replied for the others.

    For example (assuming you have created a session):

    [FBRequestConnection startWithGraphPath:@"/me/events/not_replied" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
    {
        FBGraphObject* data = (FBGraphObject*)result;
        NSMutableArray* array = [data objectForKey:@"data"];
    
        //parse data etc..
    }];
    

    See https://developers.facebook.com/docs/graph-api/reference/v2.0/user/events/ for more info.

提交回复
热议问题