我尝试获取用户事件。
登录后,我用以下代码询问用户标识:

[[[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 Explorer中我得到了数据!!

谢谢

最佳答案

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

代替“我”使用“我/事件”来获取用户事件……

关于ios - Facebook SDK 2.4如何从用户那里获取事件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32437731/

10-11 17:13