Here’s the complete solution addressing all aspects of your offline sync problem:
1. Offline Form Data Persistence:
Implement persistent storage with sync queue management. Update your mobile config:
offlineEnabled: true
persistentSyncEnabled: true
syncQueueMaxSize: 100
retryFailedSync: true
The persistentSyncEnabled flag ensures forms are stored in device’s persistent storage (not just memory) and survive app restarts and network changes.
2. Background Sync Configuration:
Configure aggressive sync retry logic:
syncOnConnect: true
syncOnResume: true
syncRetryInterval: 300
maxSyncRetries: 5
This creates multiple sync opportunities: on network connect, app resume, and scheduled intervals. The retry mechanism handles transient network failures.
3. Network Change Handling:
The critical piece is handling network transitions gracefully. Appian Mobile 22.4 has a known issue where rapid network switches can interrupt sync. Implement these workarounds:
- Set
syncDebounceDelay: 5000 (5 seconds) to prevent sync attempts during rapid network fluctuations
- Enable
networkChangeMonitoring: true which detects network switches and reschedules interrupted syncs
- Use
syncOnlyOnWiFi: false to allow cellular sync as fallback
4. Mobile OS Background Data Permissions:
iOS (Info.plist):
<key>UIBackgroundModes</key>
<array>
<string>processing</string>
<string>fetch</string>
<string>remote-notification</string>
</array>
Also request “Background App Refresh” permission programmatically on first launch.
Android (AndroidManifest.xml):
Add these permissions:
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
Additional Recommendations:
-
Increase offline storage: Change maxOfflineStorage: 200MB to accommodate form data during extended offline periods
-
Implement sync status UI: Show users pending sync count and allow manual sync trigger. This prevents users from assuming data is saved when it’s only queued
-
Add conflict resolution: Configure conflictResolution: 'clientWins' or 'serverWins' based on your business logic
-
Monitor sync health: Enable mobile analytics to track sync success rates:
mobileAnalytics: true
trackSyncEvents: true
- Test network transitions: Specifically test WiFi→Cellular, Cellular→WiFi, and Airplane mode scenarios during form submission
Upgrade Consideration:
Appian 23.2+ has significantly improved offline sync reliability with better network change handling. If possible, consider upgrading as it includes:
- Automatic sync queue recovery after network transitions
- Better iOS/Android background task management
- Enhanced sync conflict detection
After implementing these changes, your data loss should drop to near zero. The key is the combination of persistent storage, retry logic, network monitoring, and proper OS permissions working together. Monitor your sync success rates through mobile analytics for 2-3 weeks to verify improvement.