react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

iOS & android keychain items are not erased when the app is uninstalled

Open tarangshah19 opened this issue 1 year ago • 1 comments

iOS & android keychain items are not erased when the app is uninstalled

tarangshah19 avatar Mar 04 '24 10:03 tarangshah19

Hi there, You mean iOS only, right? It is a feature and there are many dev wanted it to support Android.

Btw, to fix that issue, you can use other packages like https://github.com/react-native-async-storage/async-storage since its storage data will be removed when App is uninstall so you just need to save a flag value and use that to remove keychain value, EX:

const isAppInitialled = await AsyncStorage.getItem('isAppInitialled'); //Should be empty when App is first Install

if (!isAppInitialled) {
    //Delete Keychain data 
    Keychain.resetGenericPassword(...);
}


await AsyncStorage.setItem('isAppInitialled', 'true');

``

bdtren avatar Mar 05 '24 14:03 bdtren

+1

badredaha avatar Jan 03 '25 18:01 badredaha

try this https://github.com/emeraldsanto/react-native-encrypted-storage#note-regarding-keychain-persistence

mehranjavid avatar Jan 17 '25 09:01 mehranjavid