I am new to the KMM world, coming from Android background.
While I could easily modulize my code and use the kmm for my business logic in a common module, there are still some small things that do not work as nicely as expected.
Today after trying to build the common module for iOS, it seems like I was using Android’s base64 decoder in my common code.
The easiest thing which popped into my mind was to use the expect and actual. Then it worked fine for Android, but it was not possible to make the actual method for iOS to decode a simple base64 string.
I was wondering if there are any workarounds to decode Base64 in a common module.
I also faced a similar issue when migrated my project to use Kotlin Multiplatform.
Currently my project uses Ktor (instead of Retrofit) and everything works fine. But the Base64 decode is still a huge problem.
@dalewking:
The Ktor Base64 decoder seems to be an internal Ktor API which I could not use in my KMM project.
It is also marked as deprecated(?) in the docs: https://api.ktor.io/1.4.1/io.ktor.util/decode-base64.html
It would be amazing if I could find a workaround to use it.
I have the same problem and in the end, I wrote it by myself, but I would love to see it in the std lib.
BTW the ktor APIs are just renamed, but are still included.