I tried to using flutter secure storage for some of my apps, what I realised when I uninstall the apps and install those apps again is that the data on flutter secure storage that I stored on previous apps that I uninstalled, still persist and got on those new apps. Does anyone know how to delete this data on iOS when I uninstall the apps?
It is working fine in Android - when I delete those apps on android and install them again, the data is fresh
Asked
Active
Viewed 2,076 times
7

Viraj Doshi
- 771
- 6
- 26

Philipus Silaen
- 221
- 2
- 17
-
1https://stackoverflow.com/a/57937650/5810744 β Alexander Kremenchuk Feb 23 '22 at 16:54
-
Any luck on resolving this issue? I am running into a similar issue on my s22 running Android 13. Only happens on that device not even other Android 13 devices. β Anthony Barbosa Aug 08 '23 at 14:01
2 Answers
0
Flutter Secure Storage uses KeyChain for IOS. and this is the default KeyChain behavior.
Potential solutions is to use Shared Preferences and create a flag to determine if the app was run before.
static const kSecureClearFlag = 'SOMETHING';
final hasRunBefore = pref.getBool(kSecureClearFlag) ?? false;
if(!hasRunBefore) {
secureStorage.deleteAll();
pref.setBool(kSecureClearFlag, true);
}
you can call this on your SecureStorageService initialization, and values won't be persisted across reinstalls.

Jalal Addin Okbi
- 1
- 1
-1
Have the same issue with iOS app. And I've started to ask myself a question: is it possible that this data persist even between two apps which store same keys? This is unlikely I hope and the problem goes only to persistent of the storage after app was deleted.
-
1As itβs currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). β Community Dec 18 '21 at 14:57