I’m trying to download an image from a URL using Okio in Kotlin Multiplatform, but I couldn’t find any examples or documentation on how to do this. I have a function that retrieves a wallpaper download URL, and I want to use Okio to download the image. Here’s what I have so far:
fun downloadWallpaper(
wallpaperId: String
) {
getWallpaperDownloadUrl(wallpaperId) { wallpaperUrl ->
// Logic to download image
addMessage(InfoUiMessage(message = Res.string.wallpaper_downloaded))
}
}
any help would be appreciated