Does Kotlin Multiplatofrm for mobile support execu...
# multiplatform
p
Does Kotlin Multiplatofrm for mobile support execution when iOS app is moved into background?
f
It’s on iOS API side not purely kotlin side
and you can call the API with kotlin
p
So that means KMM's network API can be called during app being in background? I was wondering if iOS wake up the app and then KMM code can be executed, right?
f
If you want to work with background on iOS, you need to understand how it works, it’s more limited than android. https://developer.apple.com/documentation/backgroundtasks
on iOS, you can’t just do something in the background
p
Using
BackgroundTasks
framework we can use two tasks [
BGProcessingTask, BGAppRefreshTask
] as available from it to execute when app wake up in background. But the thing I am not sure is does it allows KMM API also to be called from these tasks or not.
s
KMP is just sharing code. And when compiled for iOS, it's just plain native (LLVM) iOS code Using KMP does not influence whether its contained code can be called in the background or not.
👍 1