1

我们可以访问在共享同一应用组的应用启用钥匙串共享之前保存的钥匙串项目吗?如果否,那么最好的解决方法是什么?

4

1 回答 1

0

开启keychain共享所有keychain项前“accessGroup”为(AppIdentifierPrefix).bundleIdentifier,开启后改为(AppIdentifierPrefix).keyChainGroupName。

解决方法是通过钥匙串访问它们来删除所有钥匙串项目。

AWSUICKeyChainStore *keychain = [AWSUICKeyChainStore keyChainStoreWithService:@"ServiceName"];
for (NSDictionary *dictionary in keychain.allItems)
    if ([dictionary[@"accessGroup"] isEqualToString:"(AppIdentifierPrefix).bundleIdentifier"])
        [keychain removeItemForKey:dictionary[@"key"]];
于 2017-10-26T12:36:55.520 回答