sameerkapps / SecureStorage

118 stars 32 forks source link

storage location #2

Closed ronpf closed 8 years ago

ronpf commented 8 years ago

Where is this data stored? I deleted a test iOS app running on a simulator but the data stored with this plugin persisted. Can you also please describe it's encryption technique.

sameerkapps commented 8 years ago

Thanks for using the plugin. On iOS, the data is stored using standard KeyChain encryption mechanism. The data that is stored is persisted after deleting an app is the behavior of iOS. As per Apple employee, iOS does not delete data after an app has been uninstalled. https://forums.developer.apple.com/message/75464#75464

That data cannot be accessed by any other app. If you have a case that requires that after “install->uninstall->(re)install” sequence, the data should be reset, you use this technique to detect the sequence. http://stackoverflow.com/questions/4747404/delete-keychain-items-when-an-app-is-uninstalled

When re-install is detected, call DeleteKey method in the SecureStorage accordingly. Hope this helps.

If you want to see the implementation details, they can be found here: https://github.com/sameerkapps/SecureStorage/blob/master/SecureStorage/Plugin.SecureStorage.iOSUnified/SecureStorageImplementation.cs