Releases: react-native-async-storage/async-storage
v1.10.0
Core - v2.0.0-rc.3
Fixes
AsyncStorageFactory
types
Chores
- Updated Mobile example app
Web Storage - v2.0.0-rc.3
Chores
- version update to match Core
Legacy Storage - v2.0.0-rc.3
Fixes
multiGet
/multiSet
methods- Empty error thrown on calling
.clearStorage
v1.9.0
v1.8.1
v1.8.0
❗️ Features - Possible a Breaking Change for iOS Platform ❗️
Note: If you're planning on upgrade, please use v1.8.1 and up.
- Moved storage location to Application Support. Read the description below to find out more.
Thanks @HeyImChris ! (#274) 4e49db6
Fixes
- Don’t reset the storage when the manifest file cannot be read because of iOS data protection.
Thanks @aleh ! (#270) 36e9a12
(iOS) New Locations for storage - new feature overview
So far, Async Storage has used NSDocumentDirectory
(and NSCachesDirectory
for tvOS
) location to store the manifest file, where all data is saved.
NSDocumentDirectory
- This folder is visible on iOS in scenarios where you can view the Files structure. For instance, in Word/PPT/Excel, a user can tap through to this and see a folder titled "RCTAsyncLocalStorage_V1".
NSCachesDirectory
- Apple documents this as a location that can get purged in low memory scenarios "the system may delete the Caches directory on rare occasions when the system is very low on disk space."
Those two location are not best place to keep user data. The new location, the Application Support directory (NSApplicationSupportDirectory
), is described as "[containing] all app-specific data and support files" and it can safely contain user data. There is not risk of this purging in low memory situations and this isn’t visible to iOS users.
This feature also includes a migration process. On app startup, a check is run to see if Application Support
contains the manifest file:
- If it does, do nothing
- if it does not, copy over the manifest from previous location (either NSDocumentDirectory
or NSCachesDirectory
)
This is considered as breaking change, as some dependencies might still use older version of AS or the one available from the React Native core. In that case, both old and new locations are used, so unexpected behavior might occur. Ideally, you’ll want to make sure that only one version of AS is used within your Application.
Thanks @HeyImChris for implementing this feature!
Core - v2.0.0-rc.2
Fixes
__DEV__
global variable causing issues on web platform- default factory options are now correctly applied (enables simple logger and error handler if options are omitted)
Chore
- Updated docs
Web Storage - v2.0.0-rc.2
Features
- Web storage now can use one of three storage implementations: session storage, local storage and default idb-keyval
Chore
- Updated docs to reflect changes
Legacy Storage - v2.0.0-rc.2
Chore
- Updated docs