问题
I wrote some code to share data between an application and an extension. The code works perfectly with "Action Extension" while it fails with "Custom keyboard" extension.
Each access to the keychain from the "Custom keyboard" extension ends with the same error status: -25291, errSecNotAvailable, "Key Chain not available" or "Keychain Manager was not loaded".
Is there a known limitation on accessing the keychain from a custom keyboard extension ? I did not find anything about that.
Regards. Sébastien Brault.
回答1:
In fact the solution was in Apple's documentation : "By default, a keyboard has no network access and cannot share a container with its containing app. To enable these things, set the value of the RequestsOpenAccess Boolean key in the Info.plist file to YES. Doing this expands the keyboard’s sandbox."
It just worked. Regards. Sébastien.
来源:https://stackoverflow.com/questions/29127443/access-the-keychain-from-ios-keyboard-extension