const syncOptions = {
installMode: codePush.InstallMode.ON_NEXT_RESTART,
mandatoryInstallMode: codePush.InstallMode.ON_NEXT_RESUME,
minimumBackgroundDuration: 600,
deploymentKey: codePushKey,
};
const runSync = () => {
codePush.sync(syncOptions, onSyncStatusChanged, onDownloadProgress);
};
// Replicates codePush.CheckFrequency.ON_APP_RESUME ourselves: an initial
// check on launch, then one on every foreground.
runSync();
AppState.addEventListener('change', newState => {
if (newState === 'active') {
runSync();
}
});
add a mandatory update... background it... resume it 10 minutes later... no update is installed. User is forced to RESTART to see the change.
Setup your app as follows for sync:
add a mandatory update... background it... resume it 10 minutes later... no update is installed. User is forced to RESTART to see the change.