-
-
Notifications
You must be signed in to change notification settings - Fork 238
Description
I'm running into an issue when upgrading react-native-sensitive-info on Android and hoping for some guidance.
We are upgrading:
react-native: 0.74.7 β 0.77.3
react-native-sensitive-info: 5.5.8 β 5.6.2
Issue
On Android, the app using v5.6.2 is unable to read data that was saved by the older app using v5.5.8.
This works perfectly fine on iOS, but fails on Android.
How data was saved (old app β v5.5.8)
SInfo.setItem(
'TEST_DATA_KEY',
'test_data_123',
{
sharedPreferencesName: 'TEST_DATA_KEY',
keychainService: 'USER_SETTINGS_KEYCHAIN',
},
)
.then(() => {
console.log('Data Saved!');
})
.catch(err => {
console.log(err);
});
How data is read (new app β v5.6.2)
This is how I'm reading the data:
SInfo.getItem(
'TEST_DATA_KEY',
{
keychainService: 'USER_SETTINGS_KEYCHAIN',
},
)
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
Error
Failed to retrieve "TEST_DATA_KEY": Secret 'TEST_DATA_KEY' not found in service 'USER_SETTINGS_KEYCHAIN'
Environment
Device: Pixel 8
Android version: Android 16
iOS: Works as expected
From the release notes, I noticed there were changes to how data is stored, and it says automatic migration should happen, but I can't get it to work.
Any help or guidance would be greatly appreciated.
Thanks in advance! π