For quite some time, I have been successfully reading and writing private keychain items using the ARC version of KeychainItemWrapper.
I'm now working to convert my iOS app to use a shared access group so that the keychain items can be accessed by my 2 apps that share the same app prefix. In the Capabilities section, I've added the keychain group "MYAPPPREFIX.MYSHAREDACCESSNAME"
I'm using these lines to write my variable to the keychain group:
keychainItemWrapper = [[KeychainItemWrapper alloc] initWithIdentifier:key accessGroup:@"MYAPPPREFIX.MYSHAREDACCESSNAME"];
[keychainItemWrapper setObject:value forKey:(__bridge id)(kSecAttrAccount)]; // store the new value in the keychain
If accessGroup is specified as nil, it works great. However, if I specify the access group, I get a crash with the following error in the debugger log:
Assertion failure in -[KeychainItemWrapper writeToKeychain], ..../KeychainItemWrapper.m:329 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'
The resulting OSStatus error code is -25243 which I haven't been able to track down for more information.
Is there something else I might need to do in order to write to the shared access group?