AsyncStorage setup in React Native app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
AsyncStorage setup in React Native app
Simple
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Setting up AsyncStorage in React Native Application

AsyncStorage is the simplest key-value storage for React Native. Asynchronous, unencrypted, stores strings. Suitable for user preferences, onboarding flags, lightweight data caching. Not suitable for authorization tokens (no encryption), large data volumes, complex queries.

Installation

Starting with React Native 0.59, AsyncStorage moved from core to a separate package:

npm install @react-native-async-storage/async-storage

For iOS: cd ios && pod install. For Android, linking is automatic.

Basic Usage

import AsyncStorage from '@react-native-async-storage/async-storage';

// Write
await AsyncStorage.setItem('onboarding_complete', 'true');

// Read
const value = await AsyncStorage.getItem('onboarding_complete');

// Objects — JSON only
await AsyncStorage.setItem('user_prefs', JSON.stringify({ theme: 'dark', lang: 'ru' }));
const prefs = JSON.parse(await AsyncStorage.getItem('user_prefs') ?? '{}');

// Delete
await AsyncStorage.removeItem('onboarding_complete');

// Batch operations
await AsyncStorage.multiSet([
  ['key1', 'value1'],
  ['key2', 'value2'],
]);

Android size limit. By default, AsyncStorage on Android is limited to 6 MB. Exceeding this causes Database size exceeded the quota error. Increase the limit via AndroidConfig in android/app/src/main/java/.../MainApplication.java:

new ReactNativeHost(this) {
  @Override
  protected List<ReactPackage> getPackages() {
    // ...
  }
}

Or set via AsyncStorageExtraConfig.setMaxSizeConfig in MainApplication. For larger storage needs, use react-native-mmkv (faster, no limits) or SQLite via react-native-quick-sqlite.

Type-Safe Wrapper

Direct getItem/setItem calls with JSON parsing scattered throughout code is bad practice. Wrap in a typed service:

const StorageService = {
  async get<T>(key: string): Promise<T | null> {
    const raw = await AsyncStorage.getItem(key);
    return raw ? (JSON.parse(raw) as T) : null;
  },
  async set<T>(key: string, value: T): Promise<void> {
    await AsyncStorage.setItem(key, JSON.stringify(value));
  },
  async remove(key: string): Promise<void> {
    await AsyncStorage.removeItem(key);
  },
};

What Not to Store in AsyncStorage

Authorization tokens — use react-native-keychain or expo-secure-store. They store data in iOS Keychain and Android Keystore — encrypted, protected by biometry.

Timeline

Installation and basic setup: 2–4 hours. With typed service and Redux Persist or Zustand integration: 4–8 hours. Cost calculated individually.