Open ds8k opened 7 years ago
Hmm.. strange.. we will investigate..
Hi, I have the same issue. I think It's only for iOS10, iOS9 lower work fine.
I have a crappy work-around:
#if TARGET_IPHONE_SIMULATOR
#else
// No previous item found; add the new one.
result = SecItemAdd((__bridge CFDictionaryRef)[self dictionaryToSecItemFormat:keychainItemData], NULL);
NSAssert( result == noErr, @"Couldn't add the Keychain Item." );
#endif
At the very least this lets me test other features out in the simulator
A very slightly less crappy workaround:
#if !TARGET_OS_SIMULATOR
// No previous item found; add the new one.
result = SecItemAdd((__bridge CFDictionaryRef)[self dictionaryToSecItemFormat:keychainItemData], NULL);
NSAssert( result == noErr, @"Couldn't add the Keychain Item." );
#endif
This gets rid of the useless else and uses a non-deprecated macro.
That said, a similar plugin seems to have this working without crashing, but also seems to have a lot of conditional code for simulators: https://github.com/driftyco/cordova-plugin-ios-keychain
EDIT: I did some research on the library you are using KeychainItemWrapper.m
and it seems there is an open bug for the iOS 10 simulator - https://forums.developer.apple.com/thread/51071.
It also seems that the workaround is relatively simple for native projects - to enable keychain sharing in Xcode.
It's slightly more complicated for cordova projects - you may need to integrate the entitlement hook from this plugin https://github.com/Telerik-Verified-Plugins/Keychain-Sharing.
just went to xcode 8.. so i got to fix this
According the the apple forums relating to that keychain library you are using, the easiest way to fix this is to enable keychain sharing. If you can implement this as part of your plugin, I think this would be a decent work around until it is fixed up stream.
Getting this crash when attempting to build to the simulator in Xcode 8: