如何在iOS应用程序之间共享钥匙串数据 [英] How to share keychain data between iOS applications

查看:357
本文介绍了如何在iOS应用程序之间共享钥匙串数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在描述一个问题,我花了很长时间来学习答案。

I am describing a problem for which it took me quite some time to learn the answer.

GenericKeychain 示例是提供在应用程序之间共享密钥链数据的包装器的良好开端当在init中使用accessGroup时。

The "GenericKeychain" example is a good start at providing a wrapper for sharing keychain data between applications when using the accessGroup in the init.

然而,在我的应用程序中实现这一点产生了一个模糊的错误代码(永远定位)-25243,这意味着:无法访问控制。

However, implementing this in my app yielded an obscure error code (which took forever to locate) -25243, which means: No access control.

我在iPad上运行Apple的示例应用程序(GenericKeychain)只是为了得到同样的错误。嗯?

I ran Apple's example app (GenericKeychain) on my iPad only to get the same error. Huh?

Apple的文档是否无法实现完成此任务所需的内容?

Does Apple's documentation fail to deliver on what is necessary to accomplish this?

推荐答案

经过一些(很多)挖掘整个网络后,我找到了答案。您在构造KeychainItemWrapper类时使用的访问组也必须在keychain-access-groups部分的每个应用程序的Entitlements.plist文件中指定。

After some (a lot of) digging throughout the web, I found the answer. The access Group that you use when constructing your KeychainItemWrapper class must ALSO be specified in each of your application's Entitlements.plist file in the "keychain-access-groups" section.

现在我看到 keychain-access-groups 似乎很明显。但是,我甚至不知道在那里看。希望这有助于其他人。

It seems almost obvious now that I see "keychain-access-groups". However, I had no idea to even look there. Hope this helps others.

这篇关于如何在iOS应用程序之间共享钥匙串数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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