Thread
#multiplatform
    Stefan Oltmann

    Stefan Oltmann

    7 months ago
    I want my app to sync in the background. For Android there is the WorkManager and iOS has a BGTaskScheduler. What is the best practice to do that on Windows/JVM (Compose for Desktop) and macOS (SwiftUI native)? And the real question: Does anybody already know a Kotlin framework that builds on top of all those so I have to code it just once? 🙂
    d

    darkmoon_uk

    7 months ago
    Look at Coroutines, and using either IO Dispatcher or perhaps your own single-background-threaded Dispatcher. This is now well supported across all the Kotlin Multiplatform targets, so you could expect to write all your sync logic once in common code. If you pair it with the equally multiplatform ready Ktor HTTP client, you'll be sharing all your network calls too.