7

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

Viraj Doshi
  • 771
  • 6
  • 26
Philipus Silaen
  • 221
  • 2
  • 17

2 Answers2

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.

-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.

  • 1
    As 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