Reputation: 6305
The documentation says it should be used instead of LocalStorage, but it doesn't list anything regarding how large it is. If I recall, LocalStorage in web browsers is only about 10mb.
https://facebook.github.io/react-native/docs/asyncstorage.html
Upvotes: 29
Views: 29621
Reputation: 1270
The new way of increasing AsyncStorage size on react-native is to add AsyncStorage_db_size_in_MB=
property to your android/gradle.properties
as shown here: https://react-native-async-storage.github.io/async-storage/docs/advanced/db_size/
Upvotes: 15
Reputation: 6116
As mentioned here, to increase the 6mb limit on Android.. try this:
in MainApplication.java
add these lines in onCreate
function
public void onCreate() {
// ...
long size = 50L * 1024L * 1024L; // 50 MB
com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);
}
Upvotes: 3
Reputation: 10215
On Android the limit is 6mb by default. Check this.
But you can increase that limit calling the method setMaximumSize.
Upvotes: 2
Reputation: 20808
It writes to disk and is very large if there is free space. On iOS there are no artificial caps other than what the underlying operating system imposes: https://stackoverflow.com/a/1897383/454967.
Upvotes: 22