Saturday, April 6, 2024
HomeiOS Developmentios - Keychain returns 'errSecItemNotFound' for small share of customers in Manufacturing

ios – Keychain returns ‘errSecItemNotFound’ for small share of customers in Manufacturing


Earlier than posting this query, I’ve went by means of most of comparable questions associated to Keychain entry. However I could not discover any correct reply.

I’ve an iOS app utilizing Keychain, that shops accesstoken in Keychain.
In Manufacturing, I can see from the logs that for small share of customers, Keychain returns ‘errSecItemNotFound’ when accessing Keychain after app launch.
Its arduous to breed this state of affairs.
I’ve gone by means of beneath article, that proposes to make use of ‘protectedDataAvailableNotification’, however Apple documentation says this can be true provided that the app is unlocked. However I must entry the keychain even in background & locked states.
https://medium.com/@yoav.ziv/userdefaults-value-returns-nil-although-its-shouldn-t-d55ddf832564

  1. Is there any setup must do for accessing Keychain after app launch?

  2. Beneath is the question used to entry merchandise from keychain. It has ‘kSecAttrService’ saves the important thing title and ‘kSecAttrAccount’ is all the time empty. Is it right?

    var defaults: [CFString: Any] = [
         kSecClass: kSecClassGenericPassword,
         kSecAttrService: service,
         kSecAttrAccount: "",
     ]
    
     defaults[kSecAttrAccessGroup] = accessGroup
     defaults[kSecMatchLimit] = kSecMatchLimitOne 
     defaults[kSecReturnData] = kCFBooleanTrue 
     defaults[kSecAttrAccessible] = kSecAttrAccessibleAfterFirstUnlock
     }
    

Any assist can be appreciated.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments