Storing email in keychain impossible (KeychainItemWrapper)

非 Y 不嫁゛ 提交于 2019-11-29 09:11:11
Nycen

Well, I just found the answer following the advice on that page iOS KeychainItemWrapper not updating, which is to add

[keychainWrapper setObject:@"Myappstring" forKey: (id)kSecAttrService];

I know its an old question, but that was happening to me and the above answers did not fix my problem. In my case I was accessing the keychain when the phone was locked. Finally I got to solve it by using this just after init the keychain.

keychainWrapper.setObject(kSecAttrAccessibleAlways, forKey: kSecAttrAccessible)

It seems that keychain does not let you access it unless your phone is unlocked, by default.

More info here : http://b2cloud.com.au/tutorial/using-the-keychain-to-store-passwords-on-ios/

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