After configuring it based on the instructions I keep on getting this error and I am unable to successfully use Facebook Login on my app. I am running it on XCode 8.1 and using an iOS 10.1 simulator.
I followed the steps on the Facebook iOS SDK guide and put the Facebook login button in my view controller. I displayed the NSUserdefaults and one of the keys is "com.facebook.sdk:serverConfiguration" so I believe it is saving there.
- (void)viewDidLoad {
[super viewDidLoad];
if ([FBSDKAccessToken currentAccessToken]) {
// User is logged in, do work such as go to next view controller.
NSLog(@"test");
}
else {
FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
loginButton.center = self.view.center;
[self.view addSubview:loginButton];
}
_loginButton.readPermissions =
@[@"public_profile", @"email", @"user_friends"];
NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);
}
If the problem is that the iOS Simulator is signed out after a restart of the app, this is caused by a bug in the Facebook SDK. It prevents the simulator from caching the access token.
You can fix this by adding the following line:
key = [NSString stringWithFormat:@"%@_fix", key];
in
FBSDKKeychainStore.m:94
andFBSDKKeychainStore.m:135
just before:[[NSUserDefaults standardUserDefaults] setObject:value forKey:key];
To get rid of these rather annoying log messages (that's all they are), go to FBSDKCoreKit's FBSDKKeychainStore.m file and comment lines 93 and 134:
Voilá... gone!
Note: This is current for Facebook SDK for iOS version 4.23.0.
For CocoaPods: The file can be found in your Xcode workspace under:
Pods > Pods > FBSDKCoreKit > FBSDKKeychainStore.m