Nan Nan - 13 days ago 8
iOS Question

Facebook Login Status Check Issue

When user open Facebook Setting View, how to identify the current log in status. And if it is logged, how can i retrieve the users' further information. such as birthday, age, gender, etc.

i wrote this piece of code, which is not working. Thanks in advance.

- (void)viewDidLoad {
[super viewDidLoad];

if ([FBSDKAccessToken currentAccessToken]) {

//Going to another ViewController, which include user's name,
//age, photo and so on.
} else {
FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init]; =;
[self.view addSubview:loginButton];


if ([FBSDKAccessToken currentAccessToken]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
  if (!error) {
     NSLog(@”fetched user:%@”, result);

Try this its working . here is document to get information about SDK 4.0

Here are Some graph api key.

"user_friends" , 
"user_work_history" ,
"user_birthday" ,