I\'ve just \"upgraded\" my Facebook SDK to 4.0 for my iOS app.
I\'ve got the log in working okay, however, according to the documentation, I\'m now supposed to use
I'm in objc but ran into this problem as well.
First, Johnny Z's answer is correct that you have to explicitly enable the FBSDKProfile class by setting 'enableUpdatesOnAccessTokenChange' to true and then observing changes. In fact, that's what FBSDKProfile is doing internally according to the header comments.
However, as noted by fanfan in a comment, the FBSDKProfile doesn't have all of the fields you might be interested in. I ended up not using FBSDKProfile and just made a graph request for 'me' like so:
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (error) {
CLS_LOG(@"Login error: %@", [error localizedDescription]);
return;
}
NSLog(@"fecthed user: %@", result);
}];
Note: You can still observe changes with the 'FBSDKProfileDidChangeNotification' notification. Read FBSDKAccessToken.h comments for documentation of this notification and the keys it will send.