Storing email in keychain impossible (KeychainItemWrapper)

后端 未结 2 1544
既然无缘
既然无缘 2020-12-18 20:11

I\'m using the ARCified version of KeychainItemWrapper available at github, and I can\'t get it to store both email and password.

KeychainItemWrapper *keycha         


        
2条回答
  •  甜味超标
    2020-12-18 20:31

    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/

提交回复
热议问题