2014-01-30 84 views

回答

1

你應該以這種方式獲得的電子郵件地址:

[user objectForKey:@"email"]//Where user is FBGraphUser type 

下面是實現當登錄成功

case FBSessionStateOpen: { 

      NSLog(@"accessToken: %@", session.accessTokenData.accessToken); 
      [[FBRequest requestForMe] startWithCompletionHandler: 
      ^(FBRequestConnection *connection, 
       NSDictionary<FBGraphUser> *user, 
       NSError *error) { 
       if (error) { 
        //error 
       }else{ 
        NSLog(@"%@, %@",[user objectForKey:@"email"], user.description); 

       } 
      }]; 
     } 
     break; 
0

試試這個:

facebook = [[Facebook alloc] initWithAppId:[self _APP_KEY] andDelegate:self]; 
[facebook authorize:[NSArray arrayWithObjects:@"email",nil]]; 
相關問題