martinkasa / capacitor-secure-storage-plugin

Capacitor plugin for storing string values securly on iOS and Android.
MIT License
155 stars 56 forks source link

IOS: storage does not get cleared on app uninstall #31

Closed tjblackheart closed 3 years ago

tjblackheart commented 3 years ago

See title. On testing the app on IOS 11 out of Testflight the storage does not get cleared after an app uninstall and all data still is there if you install again. I suppose that's an IOS thing ... is there a way to force this? Works fine on Android devices though. The data in the store is just one entry as a big(gish) JSON string.

zbarbuto commented 3 years ago

This is just part of how keychain works on iOS.

You can update your app delegate to remove keys on first launch.

https://github.com/jrendel/SwiftKeychainWrapper/issues/98#issuecomment-375686104

tjblackheart commented 3 years ago

Oh, thanks for the heads up. Closing this.

dahyui commented 3 years ago

@tjblackheart Did you manage to get the wrapper to delete on first launch? I added the check as mentioned in the comment but nothing gets delete, so not sure if I'm missing something else?

tjblackheart commented 3 years ago

Hey @dahyui, I have no IOS machine for developing on, so I did a similar workaround: In the (unencrypted) capacitor store I check for a "first_run" key, if that's not there, I just force delete everything and then set it. Works well enough for me but probably doesn't answer your question, sorry about that.

bialabs commented 2 years ago

This is just part of how keychain works on iOS.

You can update your app delegate to remove keys on first launch.

jrendel/SwiftKeychainWrapper#98 (comment)

Tried but removeAllKeys() returns false and Keychain is not cleared Any suggestions?