I am working on an iOS 5 app where i need to get user profile data after successful login.
For now I am getting a access token when user get successful login.
Now I am trying to get Facebook logged in user profile data using that access token.
I tried to follow the sample app provided on the Facebook developer site.
I am not using FBconnect type resource file. I add "facebookSDK.framework" from sample app.
Please help me.
Thanks,
- (void)populateUserDetails {
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
// First request uploads the photo.
FBRequest *request1 = [FBRequest requestForMe];
if (FBSession.activeSession.isOpen) {
[connection addRequest:request1
completionHandler:
^(FBRequestConnection *connection, NSDictionary<FBGraphUser> *user, NSError *error) {
if (!error) {
NSLog(@"fb user name = %@",user.name);
NSLog(@"fb user name = %@",user.id);
}
NSLog(@"fb2 user name = %@",user.name);
NSLog(@"fb2 user name = %@",user.id);
}
//batchEntryName:@"photopost"
];
[connection start];
}
}