Here is my code , I am only getting user name and facebook id of user.
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login
logInWithReadPermissions: @[@"public_profile",@"email",@"user_friends"]
fromViewController:self
handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
NSLog(@"Process error");
} else if (result.isCancelled) {
NSLog(@"Cancelled");
} else {
if ([FBSDKAccessToken currentAccessToken]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@", result);
}
}];
} NSLog(@"Results=%@",result);
NSLog(@"Logged in");
}
}];
and it also give some error like this -
-canOpenURL: failed for URL: "fbauth2:/" - error: "(null)" -canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
FBSDKLog: starting with Graph API v2.4, GET requests for /me should contain an explicit "fields" parameter