Prompt
I'm building a React Native app and need offline sync and push notifications
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
Here’s a practical way to think about offline sync and push notifications for a React Native app.
1) Offline sync: what you need
A good offline-first setup usually has:
- Local database on the device
- Sync engine to push/pull changes
- Conflict resolution strategy
- Network awareness to retry when connectivity returns
- Background sync if you want updates without opening the app
Common choices
Local storage
- SQLite: solid, predictable, works well for structured data
- WatermelonDB: great for larger datasets and offline-first apps
- Realm: easy developer experience, good offline support
- AsyncStorage: okay for small key/value data, not ideal for real sync
Sync approach
- Custom sync API: your backend exposes endpoints like:
GET /changes?since=cursorPOST /sync
- GraphQL + offline cache: possible, but more complex
- Backend-as-a-service with offline features:
- Firebase / Firestore
- Realm Sync
- CouchDB/PouchDB style replication
Recommended offline sync pattern
- Save all edits locally first
- Mark records as
pendingSync - When online:
- upload local changes
- fetch remote changes since last sync token
- Merge data
- Resolve conflicts
Conflict strategies
- Last write wins: simplest, but can lose data
- Version numbers / timestamps
- Field-level merge
- Manual user resolution for important data
2) Push notifications
For React Native, the standard approach is:
- Firebase Cloud Messaging (FCM) for Android
- Apple Push Notification service (APNs) for iOS
- Use a library like:
- @react-native-firebase/messaging
- optionally notifee for displaying/local notification handling
Typical flow
- App asks for notification permission
- App gets a device token
- Token is sent to your backend
- Backend sends push via FCM/APNs
- App handles notification:
- when app is foreground
- background
- terminated
Important notes
- You need a backend to send pushes securely
- For iOS, configure APNs and notification permissions
- For Android 13+, request notification permission at runtime
- Use data messages if you want custom behavior, but handle them carefully
3) Best stack options
If you want fastest setup
- Firebase Firestore + FCM
- Firestore has built-in offline support
- FCM handles push notifications
- Great if your data model fits Firestore
If you want more control
- React Native app
- SQLite or WatermelonDB
- Custom sync API
- FCM/APNs through your backend
- Best when you need complex business logic or relational data
If you want enterprise/offline-heavy
- Realm
- Realm Sync
- Push notifications via FCM/APNs separately
4) Suggested architecture
- UI layer: React Native
- Local data layer: WatermelonDB / Realm / SQLite
- Sync service:
- detects network connectivity
- queues mutations
- syncs with backend
- Notification service:
- registers device token
- stores token in backend
- handles push events
- Backend:
- auth
- sync endpoints
- push notification sender
5) Practical recommendation
If you’re just getting started:
- Use Firestore if your app can work with NoSQL and you want a simple offline sync path
- Use @react-native-firebase/messaging for push notifications
- Add notifee if you need rich notification UI/control
If your app has complex relational data:
- Use WatermelonDB or SQLite
- Build a custom sync API
- Use FCM/APNs for notifications
If you want, I can also give you:
- a step-by-step architecture
- a library recommendation based on your app type
- a sample React Native implementation for offline sync + push notifications