AWSUICKeyChainStore *keychain = [AWSUICKeyChainStore keyChainStoreWithService:@"ServiceName"];
for (NSDictionary *dictionary in keychain.allItems)
if ([dictionary[@"accessGroup"] isEqualToString:"(AppIdentifierPrefix).bundleIdentifier"])
[keychain removeItemForKey:dictionary[@"key"]];
1 回答
在启用钥匙串共享之前,所有钥匙串项“accessGroup”是(AppIdentifierPrefix).bundleIdentifier,在打开之后更改为(AppIdentifierPrefix).keyChainGroupName .
解决方法是通过通过钥匙串访问所有钥匙串项来删除它们 .