nativescript-secure-storage icon indicating copy to clipboard operation
nativescript-secure-storage copied to clipboard

Is there a way to persist data across updates?

Open dlcole opened this issue 5 years ago • 9 comments

It looks like there used to be, at least on iOS. Is it possible on either platform?

dlcole avatar Jan 27 '20 22:01 dlcole

Because NS clear all the app folder when a new version is installed, it looks impossible.

hgc2002 avatar Feb 04 '20 09:02 hgc2002

Workaround: use external storage. Apparently, it's the right way to do it (and the only one supported everywhere without crossing any safety line). I'm using it right now and it goes well.

hgc2002 avatar Feb 10 '20 08:02 hgc2002

Hi, when you say updates here, were you meaning application updates or Phone OS updates?

spstratis avatar May 03 '20 15:05 spstratis

I was referring to application updates.

I don't know that you can depend on external storage being available, especially on iOS.

dlcole avatar May 04 '20 01:05 dlcole

I see, so it's confirmed that keychain data for a Nativescript app gets cleared out after application updates? Because I believe I'm seeing similar behavior in one of my applications.

spstratis avatar May 04 '20 03:05 spstratis

No, I'm not sure that's confirmed. I had understood that keychain is a way you can preserve data across application updates, and the plugin includes a method to clear data on first run. I never really pursued using this plugin but may investigate it further in the future.

dlcole avatar May 04 '20 14:05 dlcole

@dlcole the data is persisted during updates. I've used this plugin and the data is not lost during updates. For future usage one should consider #40 and maybe contribute to update to a more future-proof implementation.

madmas avatar Jul 03 '20 15:07 madmas

How would one set the save location for nativescript-secure-storage to the "external" area, be it emulated or real??

I'm currently using this library in a project and the data comes back across uninstalls and updates in iOS like I want it to, but is not persisting across Android updates.

Currently there is really no need to save this data across device changes and so persistence would be awesome.

UNIcodeX avatar Oct 02 '20 22:10 UNIcodeX

Totally agree with @UNIcodeX

darko-bw avatar Sep 09 '21 09:09 darko-bw