Is there a library or a sample app that shows how ...
# multiplatform
m
Is there a library or a sample app that shows how to handle background processing in Kotlin multiplatform?
d
i guess u should implement kotlin coroutines
m
I mean while the app is in the background
d
then i think u should make implementation for each platform unique one.
c
I don’t think anything exists quite yet. You can use WorkManager for Android and BGTaskScheduler for iOS, but you’d have to implement each one individually. Coroutines only work for apps in the foreground, and they cannot start an app that’s not already running. I’ve recently started playing around with a library that wraps those and provides a KMP API on top, but it’s still in the very early stages of development. If you’re interested in following the progress or would like to help contribute to this feature, you can see the preview announcement here https://kotlinlang.slack.com/archives/C03GTEJ9Y3E/p1697648634102369