IOS and loosing window.localStorage

hello
Local storage in iOS is suddenly lost
In Cordova Documentation they said

  • iOS stores localStorage data in a location that may be cleaned out by the OS when space is required.
    But the truth is that the space is available, and when the application is closed, the entire local storage is lost.

Is there plugin or correction to solve the problem because the application is stable on Android and the web and I do not want to rewrite new code for iOS?

I tried cordova-plugin-nativestorage but it doesn’t work

What happens when you attempt to use that plugin?

not a function

Can you try it with the N and S capitalized, like so:

NativeStorage.setItem("myValue", someValue, successCallback, errorCallback);

If that doesn’t work, it’s helpful to include the code that isn’t working and the exact error.