kishikawakatsumi/UICKeyChainStore

Cannot get keychain sharing betwen Mac app and iOS app to work

John1843 opened this issue · 1 comments

I have enabled keychain sharing in Xcode for both projects (Mac and iOS apps) using the same "Keychain groups" string.

I try to access a keychain item that I write in my iOS app from within my Mac app.

Writing:

UICKeyChainStore *keychain = [UICKeyChainStore keyChainStoreWithService:@"SendSecretToMac"];
                                                                keychain.synchronizable = YES;
                                                                keychain[@"kishikawakatsumi"] = @"01234567-89ab-cdef-0123-456789abcdef";

Reading:

UICKeyChainStore *keychain2 = [UICKeyChainStore keyChainStoreWithService:@"SendSecretToMac"];
keychain2.synchronizable = YES;
NSString *secret = keychain2[@"kishikawakatsumi"];

However, the string "secret" is always nil. What can I do about this?