2015-09-07 61 views
-1

我尝试获取用户的事件。 登录后,我询问用户ID与下面的代码:Facebook sdk 2.4如何从用户获取事件?

[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil] 
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { 

    NSLog(@"ID: %@", result[@"id"]); 

    NSString *str = [NSString stringWithFormat:@"%@/events",result[@"id"]]; 

    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] 
            initWithGraphPath:str 
            parameters:nil 
            HTTPMethod:@"GET"]; 
    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, 
              id result, 
              NSError *error) { 

     // Handle the result 

    }]; 


}]; 

结果是空的,虽然在图形API资源管理器,我得到的数据!

感谢

回答

4
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/events" parameters:nil] 

而不是 “我” 用 “我/事件” 中获得用户事件......

相关问题