OSX ACAccountStore requestAccessToAccountsWithType...在拒绝权限后返回 'granted=No' 和 error=nil

OSX ACAccountStore requestAccessToAccountsWithType... returning 'granted=No' and error=nil after denying permissions

我正在尝试请求访问我的 Facebook 帐户。我第一次 运行 进行得很顺利,我看到了请求权限的弹出窗口。弹出窗口要求我允许或拒绝。我选择拒绝是因为我想测试那个用例。现在我不知道如何让它再次允许访问。我已从我的 Facebook 帐户中删除了该应用程序,并从我的 mac 中删除了我的 Facebook 帐户。我也试过添加 属性

@"auth_type": @"rerequest"

到选项字典。无论如何我得到相同的结果。

如题所述,错误为nil,g运行ted为False。

提前致谢。

ACAccountType* accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];

NSDictionary* options = @{
                          ACFacebookAppIdKey: [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FacebookAppID"],
                          ACFacebookPermissionsKey: @[@"public_profile", @"email", @"user_friends"],
                          };

[accountStore requestAccessToAccountsWithType:accountType options:options completion:^(BOOL granted, NSError* error)
 {
        if (granted)
        {
            ACAccount* account = [[accountStore accountsWithAccountType:accountType] lastObject];
            macFacebookAccount = account;
        }
        else
        {
            NSLog(@"%@", error); 
        }
 }];

我解决了这个问题:应用程序的 Facebook 权限设置位于“系统偏好设置”>“安全和隐私”下。从那里只需单击 facebook 并选中您的应用程序旁边的框