Monday, January 26, 2026
HomeiOS Developmentswift - Easy methods to delete iOS Keychain merchandise from personal keychain...

swift – Easy methods to delete iOS Keychain merchandise from personal keychain when utilizing entry teams?


I’m utilizing Keychain on iOS to retailer some information.
The app has entitlement to a group.com.mycompany through the entry group.
I’ve added keychain merchandise beneath key my_item_key within the app’s personal keychain container and likewise created an entry within the shared keychain container (through the entry group).
If I attempt to learn by the important thing my_item_key from the personal keychain, returns the worth for the personal one, the identical if I attempt to learn my_item_key from the shared entry group keychain it returns correct worth that was saved beneath the shared one.

However, if I attempt to delete the merchandise with key my_item_key within the personal keychain, it additionally deletes the keychain merchandise within the shared container though I did not specify the entry group.

deleting with out specifying entry group:

            let question: NSMutableDictionary = [
                kSecClass as String: kSecClassGenericPassword,
                kSecAttrAccount as String: "my_item_key",
                kSecAttrService as String: "com.mycompany.appOne",
            ]
            
            let standing = SecItemDelete(question)
            print("delete standing: (standing)")
// deletes keychain merchandise from app personal keychain and shared keychain.
// even with out specifying kSecAttrAccessGroup

is that this even attainable? or deleting means deletion from each containers and I’ve to make use of totally different kSecAttrAccount keys ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments