Realm Sync when the app is closed


#1

Does the realm sync in the background when the user exits the app in iOS? I noticed that the user must have the app visible for the database to sync… Is it possible to allow syncing when the app is not open?


#2

On ios you have a little bit of time when you can finish the syncing. Otherwise, you can run code on the background.


#3

what code should be run on the background? realm automatically sync the database


#4

Yeah. That sync should be run in the background if you want background sync…
Thats was your question.


#5

Sorry if I sound like a noob but to my understanding, the realm.write {} piece of code saves the data locally, and when the user is online the syncing is done automatically… what piece of code should be run in the background? we don’t handle syncing, realm itself does it automatically