2015-09-07 63 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] 

而不是 「我」 用 「我/事件」 中獲得用戶事件......

相關問題