Hi I have a RN app which I’m saving on SecureStorage the value test SecureStore.setItemAsync('test', 'test');
I assume that if I create a new native app with the same bundle Id, I should be able to get this information after update the app. is this possible and how can I do this?
I’ve tried with KeychainWrapper KeychainWrapper.standard.string(forKey: "test")
Normally you use SecureStore.getItemAsync('itemkey') to get the item back out. Did you try using the SecureStoreOptions to set the keychainService, like this: SecureStore.getItemAsync('itemKey', {'keychainService'}) ?
The complete process can be found on my StackOverflow answer (link). Here is the most important part, that caused the problem for me:
the trickiest part is setting the correct key (kSecAttrAccount) for the keychain item I wanted to get. What helped me was to use the Flutter plugin’s readAll method (link to the native source code of readAll on GitHub). It showed me that the keychain items were actually there, but that the keys were different than the ones ReactNative app was using. As I’ve found out by debugging (it’s nowhere in the docs!!!), the expo username and expo project’s name are added before the string used for the key! So, if in the ReactNative app you save a token with key accessToken, it will be saved to the Keychain as @expousername/project-name-accessToken! It’s nowhere in the docs, and I don’t know how it happens, because I’ve looked through the source code.