Storing email in keychain impossible (KeychainItemWrapper)

后端 未结 2 1543
既然无缘
既然无缘 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/

    0 讨论(0)
  • 2020-12-18 20:55

    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];
    
    0 讨论(0)
提交回复
热议问题