Manual Sync
If you want to sync data every time a user opens the app, RookConnectConfigurationManager
provides a function called enableSync()
. Each time the app transitions from the background to the foreground, ROOK SDK will check the last sync time. If there is new data to update or pending data from previous days, it will upload this information.
We recommend using this feature in conjunction with the background sync feature.
import RookSDK
struct HomeView: View {
@StateObject var viewModel: HomeViewModel = HomeViewModel()
var body: some View {
VStack {
homeView()
}.onAppear {
RookConnectConfigurationManager.shared.enableSync()
}
}
}