2

我遇到了 iOS6 的问题,即应用程序在通过 Web 界面删除其权限后无法重新进行身份验证

它的状态在 iOS 偏好设置中保持“开启”,这并不反映 OAuth 的当前状态

当应用程序尝试进​​行身份验证但收到 OAuth 错误时,这会导致陷入困境

似乎也没有办法从内置的 facebook 偏好中手动删除权限

有没有人遇到过类似的问题?任何可能的解决方法?

4

3 回答 3

1

如果 iOS 缓存中的 Facebook 访问令牌与 Facebook 不同步,您可以强制同步凭据:

// Only do this if there is native Facebook Account support (iOS 6+)
BOOL isFacebookAccountsAvailable = (&ACAccountTypeIdentifierFacebook != NULL);
if (isFacebookAccountsAvailable) {
    ACAccountStore *accountStore = [ACAccountStore new];
    ACAccountType *accountTypeFB = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
    NSArray *fbAccounts = [accountStore accountsWithAccountType:accountTypeFB];

    for (ACAccount *fbAccount in fbAccounts)
        [accountStore renewCredentialsForAccount:fbAccount completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) {
            DLog(@"Renew account error: %@", error.localizedDescription)
        }];
}
于 2013-03-27T22:34:38.447 回答
0

我有几乎同样的问题。我试图从 Facebook 网站上的应用程序列表中删除我的应用程序。现在,当我注销并重新登录时,我得到了相同的无效令牌。我必须去我的 iPhone 上的设置并禁用我的应用程序的 facebook 访问。这将重置令牌。

SDK提供了一个方法

[FBSession.activeSession closeAndClearTokenInformation];

但它不能解决这个问题。

于 2012-09-28T13:28:33.773 回答
0

Facebook SDK 的最新更新似乎正在正确处理此案

于 2013-03-29T09:23:17.797 回答