Mobile offline support

From IsKenKenYa/1Panel-Client · View interactive version

Mobile offline support is an AI agent skill from the GitHub repository IsKenKenYa/1Panel-Client. Implement offline-first mobile apps with local storage, sync strategies, and conflict resolution. Covers AsyncStorage, Realm, SQLite, and background sync patterns.

How to use this skill

Skill file

Mobile Offline Support

Table of Contents

Overview

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

When to Use

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:

| Guide | Contents |

|---|---|

| React Native Offline Storage | React Native Offline Storage |

| iOS Core Data Implementation | iOS Core Data Implementation |

| Android Room Database | Android Room Database |

Best Practices

✅ DO

❌ DON'T

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.