Enable auto sync in the app
Go to the Setup or Settings section of your mobile app and set the following parameters in the NETWORK block:
- Auto Sync: Select when you want your app synchronized:
- On Start (app will synchronize every time it starts, even after it was running in the background)
- On Change (app will synchronize with server after every data change)
- On Start & On Change
- Sync Login: Set to Off. This disables the synchronization screen, where you enter URL, name, and password.
- Save Password: Set to On.
The on-start automatic synchronization is initiated at every app startup, unless one of the following conditions blocks it:
- Password is not saved
- Sync login is required
- Application was synchronized no more than 15 minutes ago
- No network connection is active
- There are some unresolved sync conflicts from last sync (it is indicated on the Home screen)
- Require Sync Login: Set to False.
- Auto Sync: Set up when (if) should automatic synchronization be performed.
You can optionally configure additional conditions that trigger synchronization:
- Auto Sync Delay: Set up a time period in seconds for automatic synchronization. For example, use 1200 to initiate auto sync when 20 minutes have passed since the end of previous synchronization.
- Sync before going Online / Sync before going Offline: Perform a synchronization before going into online or offline mode:
- NoAction – Do not synchronize.
- AskUserToSync – Offer the option to synchronize.
- WarnUserMustSync – Require synchronization before continuing.
- ForceSync – Force synchronization.
You have the option to Lock each field. If you do so, the users won’t be able to change these settings in their apps.
Force customization download
An update of the project customization cannot be launched during an automatic, background synchronization. When, during a background synchronization, the app discovers that there's a project update available, the sync button is replaced by a down-facing arrow button. Users can tap the button to start a manual, foreground synchronization that applies the update.
If a user does not trigger foreground sync manually, it will start automatically on application start. As soon as the metadata download (project update) is complete, the sync switches again to background mode, so that the user can start working with the app.
This feature requires that you enable automatic synchronization. Additionally, the option Background Download in Woodford's Configuration must be set to true.
The following table offers an overview of the related parameters.
|Internal name||Configuration label||App settings label||Description|
|AppSettings.AutoSyncAfterStart||#seconds to wait before syncing after application start. This is ignored if a synchronization was run within the last 15 minutes|
|Auto Sync||Auto Sync||Set up automatic synchronization. (Never, On App start, After entity form save action)|
|AppSettings.AutoSyncDelay||Auto Sync Delay||Synchronizes every X seconds even if no local changes were made. 0 means disabled.|
|AppSettings.AutoSyncAfterChange||Auto Sync in Online||Synchronizes X seconds after a change is made in Online Mode. 0 means disabled.
|AppSettings.SyncEmailOnSend||Email change triggers email sync (unless sync is already triggered)|
|AppSettings.GoingOnlineMode||Sync before going Online||Whether to synchronize before going into Online Mode: NoAction / AskUserToSync / WarnUserMustSync / ForceSync|
|AppSettings.GoingOfflineMode||Sync before going Offline||Whether to synchronize before going into Offline Mode: NoAction / AskUserToSync / WarnUserMustSync / ForceSync|