从iOS键盘扩展名访问钥匙串 [英] Access the keychain from iOS keyboard extension

查看:309
本文介绍了从iOS键盘扩展名访问钥匙串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一些代码来在应用程序和扩展之间共享数据.该代码与动作扩展"完美配合,而对自定义键盘"扩展则失败.

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.

通过自定义键盘"扩展名对钥匙串的每次访问均以相同的错误状态结束:-25291,errSecNotAvailable,钥匙串不可用"或钥匙链管理器未加载".

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.

关于. 塞巴斯蒂安·布劳特(SébastienBrault).

Regards. Sébastien Brault.

推荐答案

实际上,该解决方案在Apple的文档中:默认情况下,键盘没有网络访问权限,并且不能与其包含应用程序共享容器.要启用这些功能,将Info.plist文件中RequestsOpenAccess布尔键的值设置为YES.这样做会扩展键盘的沙箱."

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.

这篇关于从iOS键盘扩展名访问钥匙串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆