Reputation: 582
I try to get the events of user. after the login I ask the user id with the following code:
[[[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
}];
}];
The result is empty although in the graph api explorer I get the data!!
Thanks
Upvotes: 1
Views: 426
Reputation: 1398
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/events" parameters:nil]
Instead of "me" use "me/events" to get user events......
Upvotes: 6