0

我正在尝试将 facebook 集成添加到项目中。在 iOS 6+ 中,我使用以下代码请求访问用户的 Facebook 帐户。

if (self.accountStore == nil) self.accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountTypeFacebook = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[self.accountStore requestAccessToAccountsWithType:accountTypeFacebook options:options
    completion:^(BOOL granted, NSError *error) {
        if(granted) {
            self.accountsArray = [self.accountStore accountsWithAccountType:accountTypeFacebook];
            dispatch_sync(dispatch_get_main_queue(), ^{
                [self updateTable:self.accountsArray];
            });
        } else {
            NSLog(@"error: %@",error);                                               
        }
    }];

如果用户在提示访问 Facebook 帐户的模态弹出窗口中选择“取消”,是否可以在下次应用需要此访问权限时再次提示用户?

目前,如果用户首先选择“取消”,则用户必须进入“设置”应用程序并手动更改应用程序内使用 Facebook 的权限。我没有尝试直接更改此权限,我只是想多次提示用户访问。

4

0 回答 0