We're using the .NET library for Realm to synchronize data to our Xamarin iOS/Android app.
In other libraries, I've seen Pause() and Resume() methods, which are meant to be invoked when the application is backgrounded and foregrounded, respectively. For example, the library could shut down any processing that is unnecessary when the app is in the background. However, I don't see anything like that in the Realm.net library. Should anything be done for Realm when app is backgrounded or foregrounded?
It's tempting to try to suspend/resume the sync session in this case, but the documentation doesn't mention any need to use it when backgrounding/foregrounding the app, so I suspect (but I'm not certain) that it's not needed.
Realm doesn't request any background runtime from the OS, which means that the OS is free to manage the lifetime of the app as it deems fit. On Android more than on iOS your app may continue to run in the background in which case Realm will use the opportunity to try and synchronize data if there's anything to synchronize. While it is not recommended or necessary in most cases, you could definitely use Session
's Stop
/Start
API if you're concerned about the impact on battery life.