IOS - info does not removed after app uninstalled
Opened this issue · 2 comments
This is expected behaviour, when data is stored into the iOS Keychain, it's retained forever until you manually erase it. If you really, really need to erase your keychain data on a development device, you can do it by adding this to the top of AppDelegate.m
:
NSArray *secItemClasses = @[(__bridge id)kSecClassGenericPassword,
(__bridge id)kSecClassInternetPassword,
(__bridge id)kSecClassCertificate,
(__bridge id)kSecClassKey,
(__bridge id)kSecClassIdentity];
for (id secItemClass in secItemClasses) {
NSDictionary *spec = @{(__bridge id)kSecClass: secItemClass};
SecItemDelete((__bridge CFDictionaryRef)spec);
}
Now every time the app is launched, the keychain data is reset. If it's not a developer device, the only other way to reset the keychain data is to reset the phone to factory settings. I'm not sure if there's anyway to determine if it's possible to do a wipe of the keychain data during the app uninstallation, but that's a question for iOS developers/ Apple.
NSArray *secItemClasses = @[(__bridge id)kSecClassGenericPassword,
(__bridge id)kSecClassInternetPassword,
(__bridge id)kSecClassCertificate,
(__bridge id)kSecClassKey,
(__bridge id)kSecClassIdentity];
for (id secItemClass in secItemClasses) {
NSDictionary *spec = @{(__bridge id)kSecClass: secItemClass};
SecItemDelete((__bridge CFDictionaryRef)spec);
}
this code is only on firstlaunch or its forever? i mean like when we open the apps it will deleted as well?