Skip to content
mobile-offline-support logo

Mobile Offline Support

mobile-offline-support

Implement offline-first mobile apps with local storage, sync strategies, and conflict resolution. Covers AsyncStorage, Realm, SQLite, and background sync patterns.

SKILL.md

Full skill instructions

Mobile Offline Support

Table of Contents

Overview

Design offline-first mobile applications that provide seamless user experience regardless of connectivity.

When to Use

  • Building apps that work without internet connection
  • Implementing seamless sync when connectivity returns
  • Handling data conflicts between device and server
  • Reducing server load with intelligent caching
  • Improving app responsiveness with local storage

Quick Start

Minimal working example:

import AsyncStorage from '@react-native-async-storage/​async-storage';
import NetInfo from '@react-native-community/​netinfo';

class StorageManager {
  static async saveItems(items) {
    try {
      await AsyncStorage.setItem(
        'items_cache',
        JSON.stringify({ data: items, timestamp: Date.now() })
      );
    } catch (error) {
      console.error('Failed to save items:', error);
    }
  }

  static async getItems() {
    try {
      const data = await AsyncStorage.getItem('items_cache');
      return data ? JSON.parse(data) : null;
    } catch (error) {
      console.error('Failed to retrieve items:', error);
      return null;
    }
  }

// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
React Native Offline StorageReact Native Offline Storage
iOS Core Data ImplementationiOS Core Data Implementation
Android Room DatabaseAndroid Room Database

Best Practices

✅ DO

  • Implement robust local storage
  • Use automatic sync when online
  • Provide visual feedback for offline status
  • Queue actions for later sync
  • Handle conflicts gracefully
  • Cache frequently accessed data
  • Implement proper error recovery
  • Test offline scenarios thoroughly
  • Use compression for large data
  • Monitor storage usage

❌ DON'T

  • Assume constant connectivity
  • Sync large files frequently
  • Ignore storage limitations
  • Force unnecessary syncing
  • Lose data on offline mode
  • Store sensitive data unencrypted
  • Accumulate infinite queue items
  • Ignore sync failures silently
  • Sync in tight loops
  • Deploy without offline testing

More Mobile Development skills

firebase-data-connect logo
Mobile Development

firebase-data-connect

PostgreSQL-backed GraphQL backend with auto-generated type-safe SDKs for web, mobile, and Flutter.

462 158.3K
View
xcode-project-setup logo
Mobile Development

xcode-project-setup

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

462 120.2K
View
expo-dev-client logo
Mobile Development

expo-dev-client

Build custom Expo development clients for testing native code on physical devices via EAS Build or locally.

2.7K 64.8K
View
expo-module logo
Mobile Development

expo-module

Complete reference for building native modules and views with the Expo Modules API across Swift, Kotlin, and TypeScript.

2.7K 40.3K
View
swiftui-expert-skill logo
Mobile Development

swiftui-expert-skill

Expert SwiftUI code review, refactoring, and implementation guidance with iOS 26+ and macOS support.

3.7K 33.8K
View
swiftui-pro logo
Mobile Development

swiftui-pro

Comprehensive SwiftUI code review against modern APIs, accessibility, and performance standards.

5K 31.2K
View
react-native-best-practices logo
Mobile Development

react-native-best-practices

Provides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations. Applies to tasks involving Hermes optimization, JS thread blocking, bridge overhead, FlashList, native modules, or debugging jank and frame drops.

1.7K 27.9K
View
Expo App Design logo
Mobile Development

Expo App Design

Build native-feeling Expo screens — Apple HIG styling, semantic colors, and native UI patterns.

2.7K 25.2K
View
mobile-android-design logo
Mobile Development

mobile-android-design

Material Design 3 and Jetpack Compose patterns for building modern, adaptive Android applications.

40.2K 23.7K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View