The Facebook account on the device has become out-of-sync with the server and SDK's cache.
To force an update just call ACAccountStore's
method renewCredentialsForAccount
.
- (void)refreshFacebookTokenStatus
{
ACAccountStore *accountStore;
ACAccountType *accountTypeFB;
if ((accountStore = [[ACAccountStore alloc] init]) &&
(accountTypeFB = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]))
{
NSArray *fbAccounts = [accountStore accountsWithAccountType:accountTypeFB];
id account;
if (fbAccounts && [fbAccounts count] > 0 && (account = [fbAccounts objectAtIndex:0]))
{
[accountStore renewCredentialsForAccount:account
completion:^(ACAccountCredentialRenewResult renewResult, NSError *error)
{
if (error)
{
NSLog(@"%@", error.localizedDescription);
}
}];
}
}
}
The simplest would be to call it each time your app starts but this might not be efficient. So it's better to call it when the session state change occurs.
Also make sure your Facebook app settings do not have the Sandbox
option on if you're trying to login with a non-app-developer Facebook user.