Access the keychain from iOS keyboard extension

孤街浪徒 提交于 2019-12-11 13:42:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!