kishikawakatsumi / UICKeyChainStore

UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.
http://kishikawakatsumi.com
MIT License
3.08k stars 383 forks source link

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

Open John1843 opened 9 years ago

John1843 commented 9 years ago

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?

mfarhand-sa commented 3 months ago

I have the same issue, between the iOS app and Watch App. have you found any workaround?