Skip to content

Instantly share code, notes, and snippets.

@badeen
Created February 7, 2013 00:05
Show Gist options
  • Save badeen/4727126 to your computer and use it in GitHub Desktop.
Save badeen/4727126 to your computer and use it in GitHub Desktop.
[[FBSession activeSession] closeAndClearTokenInformation];
if (NSClassFromString(@"ACAccountStore")) {
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
if ([accountStore respondsToSelector:NSSelectorFromString(@"ACAccountStoreRemoveCompletionHandler")]) {
ACAccountType *fbType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSArray *accounts = [accountStore accountsWithAccountType:fbType];
ACAccount *account = [accounts lastObject];
if (account) {
[accountStore renewCredentialsForAccount:account completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) {
}];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment