Hacker News new | ask | show | jobs
by jwells89 967 days ago
If you don’t mind my asking, did the networking bits hook up to native OS facilities or was that also custom (e.g. OkHttp in place of iOS URLSession)?

One of the things that’s made solutions like this unappealing to me is how if you include networking in the shared code, you’re forgoing a bunch of platform optimizations on iOS that do things like coalesce requests to occur when the cell antenna is awake and transparently manage multi-connection situations. While it wouldn’t be too much of a problem in a simple one-note sort of app, for a more serious app that made a lot of network calls the impact is significant.

1 comments

We picked Kotlin libraries that supported KMM. So we used Apollo Kotlin, and our network requests were handled by that library's KMM translation. So there was a layer of abstraction we accepted. We never wrote raw `HttpURLConnection` code on the Kotlin side, so I'm honestly not sure what that would get translated into. KMM compiles your code into an iOS framework, so you don't actually get to see the code it creates for you (you get access to the Objective-C headers).

You're totally right, you're at the mercy of these KMM libraries and their knowledge of platform specific optimizations.