美文网首页
iOS开发-使用KeyChain保存密码等信息

iOS开发-使用KeyChain保存密码等信息

作者: BlessNeo | 来源:发表于2016-10-25 15:53 被阅读230次
  • 最近使用了KeyChain实现保存密码等敏感信息的功能,使用了SAMKeychain,但是出现了保存密码信息失败的问题,最后在stackoverflow上找到了答案。

SAMKeychain setPassword is failing

NSLog(@"SETTING VALUE %@", value);
[SAMKeychain setPassword:value forService:SERVICE_NAME account:key];
NSLog(@"READING VALUE %@", [SAMKeychain passwordForService:SERVICE_NAME account:key]);

I am always getting (null) after setting a value. This wasn't happening before I updated XCode.
Does anyone has any idea what can be the problem?

The iOS 10 keychain has been buggy since the early beta of iOS 10. As a (hopefully temporary) workaround, enable the Shared Keychain entitlement in your app. This bug affects every keychain wrapper out there, and not only SAMKeychain.

相关文章

网友评论

      本文标题:iOS开发-使用KeyChain保存密码等信息

      本文链接:https://www.haomeiwen.com/subject/gtbruttx.html