Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. [FBSession openActiveSessionWithReadPermissions:@[@"public_profile"] allowLoginUI:YES completionHandler:
  2. ^(FBSession *session, FBSessionState state, NSError *error) {
  3. // Call the sessionStateChanged:state:error method to handle session state changes
  4. [self sessionStateChanged:session state:state error:error];
  5. }];
  6.  
  7. // This method will handle ALL the session state changes in the app
  8. - (void)sessionStateChanged:(FBSession *)session state:(FBSessionState) state error:(NSError *)error
  9. {
  10. // If the session was opened successfully
  11. if (!error && state == FBSessionStateOpen){
  12. NSLog(@"Session opened");
  13. if (FBSession.activeSession.isOpen) {
  14.  
  15. // This is not working though I'm putting it as comment
  16. // [[FBRequest requestForMe] startWithCompletionHandler:
  17. // ^(FBRequestConnection *connection,
  18. // NSDictionary<FBGraphUser> *user,
  19. // NSError *error) {
  20. // if (!error) {
  21. // NSLog(@"User Info : %@",user);
  22. // }
  23. // }];
  24.  
  25. [[FBRequest requestForGraphPath:@"me"] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
  26. NSLog(@"%@",result);
  27. }];
  28. }
  29. return;
  30. }
  31.  
  32. {
  33. email = "email@domain";
  34. "first_name" = Hemang;
  35. gender = male;
  36. id = someId;
  37. "last_name" = Shah;
  38. link = "https://www.facebook.com/app_scoped_user_id/someId/";
  39. locale = "en_US";
  40. name = "Hemang Shah";
  41. timezone = "5.5";
  42. "updated_time" = "some date and time";
  43. verified = 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement