Storing keys in KeyChain with KeyChainItemWrapper

只愿长相守 提交于 2019-12-03 05:16:59

You need to use standard keys, so here your @"auth_token" is incorrect.

The keys that can be used for this purpose and the possible values for each key are listed in the “Keychain Services Constants” section.

source, with list of valid constants: Keychain Services Reference

For instance, you can use:

[_authenticationTokenKeychain setObject:authenticationToken forKey: (__bridge NSString *)kSecValueData];

[_authenticationTokenKeychain setObject:authenticationToken forKey: @"auth_token"];  

For code snippet above, key param is only can use the keys provided from sdk. You can find all in SecItem.h

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